diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 48bab182..6ea92e1d 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -67,6 +67,8 @@ import {getRoutingInstrumentation} from 'lib/sentry' import {bskyTitle} from 'lib/strings/headings' import {JSX} from 'react/jsx-runtime' import {timeout} from 'lib/async/timeout' +import {Welcome} from 'view/com/auth/onboarding/Welcome' +import {RecommendedFeeds} from 'view/com/auth/onboarding/RecommendedFeeds' const navigationRef = createNavigationContainerRef() @@ -219,6 +221,18 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) { component={SavedFeeds} options={{title: title('Edit My Feeds')}} /> + + + + ) } @@ -254,6 +268,7 @@ function TabsNavigator() { function HomeTabNavigator() { const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark) + return ( { - switch (action.type) { - case 'NEXT_STEP': - switch (state.currentStep) { - case OnboardingStep.WELCOME: - track('Onboarding:Begin') - return {...state, currentStep: OnboardingStep.COMPLETE} - case OnboardingStep.COMPLETE: - track('Onboarding:Complete') - return state - default: - return state - } - default: - return state - } -} - -export const Onboarding = () => { - const pal = usePalette('default') - const rootStore = useStores() - const [state, dispatch] = React.useReducer(reducer, initialState) - const next = React.useCallback( - () => dispatch({type: 'NEXT_STEP'}), - [dispatch], - ) - - React.useEffect(() => { - if (state.currentStep === OnboardingStep.COMPLETE) { - // navigate to home - rootStore.shell.closeModal() - } - }, [state.currentStep, rootStore.shell]) - - return ( - - {state.currentStep === OnboardingStep.WELCOME && } - - ) -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - paddingHorizontal: 20, - }, -}) diff --git a/src/view/com/auth/onboarding/RecommendedFeeds.tsx b/src/view/com/auth/onboarding/RecommendedFeeds.tsx new file mode 100644 index 00000000..d3aacb70 --- /dev/null +++ b/src/view/com/auth/onboarding/RecommendedFeeds.tsx @@ -0,0 +1,55 @@ +import React from 'react' +import {StyleSheet, View} from 'react-native' +import {Text} from 'view/com/util/text/Text' +import {usePalette} from 'lib/hooks/usePalette' +import {Button} from 'view/com/util/forms/Button' +import {NativeStackScreenProps} from '@react-navigation/native-stack' +import {HomeTabNavigatorParams} from 'lib/routes/types' +import {useStores} from 'state/index' +import {observer} from 'mobx-react-lite' + +type Props = NativeStackScreenProps +export const RecommendedFeeds = observer(({navigation}: Props) => { + const pal = usePalette('default') + const store = useStores() + + const next = () => { + const nextScreenName = store.onboarding.nextScreenName() + console.log('nextScreenName', store.onboarding.nextScreenName()) + if (nextScreenName) { + navigation.navigate(nextScreenName) + } + } + + return ( + + + + Check out some recommended feeds. Click + to add them to your list of + pinned feeds. + + + +