diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-08-29 20:20:51 -0700 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-08-29 20:20:51 -0700 |
commit | 5d9534ca7258e6165e537b89d999a8c494501dc0 (patch) | |
tree | ecbfc3b98851698be6c701ab9ee3f4796d77501d /src/view/com/auth/Onboarding.tsx | |
parent | bf37913701836091b3e902694d72d190eeca5ec9 (diff) | |
download | voidsky-5d9534ca7258e6165e537b89d999a8c494501dc0.tar.zst |
Move onboarding to the withAuthRequired HOC
Diffstat (limited to 'src/view/com/auth/Onboarding.tsx')
-rw-r--r-- | src/view/com/auth/Onboarding.tsx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/view/com/auth/Onboarding.tsx b/src/view/com/auth/Onboarding.tsx new file mode 100644 index 000000000..f43d5d93a --- /dev/null +++ b/src/view/com/auth/Onboarding.tsx @@ -0,0 +1,40 @@ +import React from 'react' +import {SafeAreaView} from 'react-native' +import {observer} from 'mobx-react-lite' +import {ErrorBoundary} from 'view/com/util/ErrorBoundary' +import {s} from 'lib/styles' +import {usePalette} from 'lib/hooks/usePalette' +import {useStores} from 'state/index' +import {useAnalytics} from 'lib/analytics/analytics' +import {CenteredView} from '../util/Views' +import {Welcome} from './onboarding/Welcome' +import {RecommendedFeeds} from './onboarding/RecommendedFeeds' + +export const Onboarding = observer(() => { + const pal = usePalette('default') + const store = useStores() + const {screen} = useAnalytics() + + React.useEffect(() => { + screen('Onboarding') + store.shell.setMinimalShellMode(true) + }, [store, screen]) + + const next = () => store.onboarding.next() + const skip = () => store.onboarding.skip() + + return ( + <CenteredView style={[s.hContentRegion, pal.view]}> + <SafeAreaView testID="noSessionView" style={s.hContentRegion}> + <ErrorBoundary> + {store.onboarding.step === 'Welcome' && ( + <Welcome skip={skip} next={next} /> + )} + {store.onboarding.step === 'RecommendedFeeds' && ( + <RecommendedFeeds next={next} /> + )} + </ErrorBoundary> + </SafeAreaView> + </CenteredView> + ) +}) |