diff options
author | Ansh Nanda <anshnanda10@gmail.com> | 2023-08-29 12:16:26 -0700 |
---|---|---|
committer | Ansh Nanda <anshnanda10@gmail.com> | 2023-08-29 12:16:26 -0700 |
commit | bf37913701836091b3e902694d72d190eeca5ec9 (patch) | |
tree | 29476c54b7ed4e42d97b0403062eff18e391e531 /src/view/com/modals/OnboardingModal.tsx | |
parent | 742440c22d9c7e671ef38f0a50dcd9397557cac6 (diff) | |
download | voidsky-bf37913701836091b3e902694d72d190eeca5ec9.tar.zst |
fix onboarding on web
Diffstat (limited to 'src/view/com/modals/OnboardingModal.tsx')
-rw-r--r-- | src/view/com/modals/OnboardingModal.tsx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/view/com/modals/OnboardingModal.tsx b/src/view/com/modals/OnboardingModal.tsx new file mode 100644 index 000000000..3862736cf --- /dev/null +++ b/src/view/com/modals/OnboardingModal.tsx @@ -0,0 +1,40 @@ +import React from 'react' +import {StyleSheet, View} from 'react-native' +import {useStores} from 'state/index' + +import {usePalette} from 'lib/hooks/usePalette' +import {isDesktopWeb} from 'platform/detection' +import {Welcome} from '../auth/onboarding/Welcome' +import {observer} from 'mobx-react-lite' +import {RecommendedFeeds} from '../auth/onboarding/RecommendedFeeds' + +export const snapPoints = ['90%'] + +export const Component = observer(({}: {}) => { + const pal = usePalette('default') + const store = useStores() + + const next = () => { + const nextScreenName = store.onboarding.next() + if (nextScreenName === 'Home') { + store.shell.closeModal() + } + } + + return ( + <View style={[styles.container, pal.view]} testID="onboardingModal"> + {store.onboarding.step === 'Welcome' ? <Welcome next={next} /> : null} + {store.onboarding.step === 'RecommendedFeeds' ? ( + <RecommendedFeeds next={next} /> + ) : null} + </View> + ) +}) + +const styles = StyleSheet.create({ + container: { + flex: 1, + paddingBottom: isDesktopWeb ? 0 : 50, + maxHeight: '750px', + }, +}) |