From edfd326069319c80f4825eb33a74295ccf667d71 Mon Sep 17 00:00:00 2001
From: Ansh Nanda <anshnanda10@gmail.com>
Date: Mon, 28 Aug 2023 13:37:44 -0700
Subject: move onboarding to screens

---
 src/Navigation.tsx | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'src/Navigation.tsx')

diff --git a/src/Navigation.tsx b/src/Navigation.tsx
index 48bab182d..6ea92e1d4 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<AllNavigatorParams>()
 
@@ -219,6 +221,18 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
         component={SavedFeeds}
         options={{title: title('Edit My Feeds')}}
       />
+      <Stack.Group
+        screenOptions={{
+          animation: 'slide_from_bottom',
+          presentation: 'modal',
+        }}>
+        <Stack.Screen
+          name="Welcome"
+          component={Welcome}
+          options={{title: title('Welcome')}}
+        />
+        <Stack.Screen name="RecommendedFeeds" component={RecommendedFeeds} />
+      </Stack.Group>
     </>
   )
 }
@@ -254,6 +268,7 @@ function TabsNavigator() {
 
 function HomeTabNavigator() {
   const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark)
+
   return (
     <HomeTab.Navigator
       screenOptions={{
-- 
cgit 1.4.1


From 3f1b313fa4abd966367327aa352567ecf8d52f2d Mon Sep 17 00:00:00 2001
From: Ansh Nanda <anshnanda10@gmail.com>
Date: Mon, 28 Aug 2023 15:41:02 -0700
Subject: add custom feed discovery to onboarding

---
 src/Navigation.tsx                                |  34 +++--
 src/lib/analytics/types.ts                        |   1 +
 src/state/models/discovery/onboarding.ts          |  29 ++--
 src/view/com/auth/onboarding/RecommendedFeeds.tsx | 160 ++++++++++++++++++++--
 src/view/com/auth/onboarding/Welcome.tsx          |  38 ++++-
 src/view/index.ts                                 |   2 +
 6 files changed, 225 insertions(+), 39 deletions(-)

(limited to 'src/Navigation.tsx')

diff --git a/src/Navigation.tsx b/src/Navigation.tsx
index 6ea92e1d4..058a15fa2 100644
--- a/src/Navigation.tsx
+++ b/src/Navigation.tsx
@@ -67,7 +67,7 @@ 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 {Welcome, WelcomeHeaderRight} from 'view/com/auth/onboarding/Welcome'
 import {RecommendedFeeds} from 'view/com/auth/onboarding/RecommendedFeeds'
 
 const navigationRef = createNavigationContainerRef<AllNavigatorParams>()
@@ -221,18 +221,26 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
         component={SavedFeeds}
         options={{title: title('Edit My Feeds')}}
       />
-      <Stack.Group
-        screenOptions={{
-          animation: 'slide_from_bottom',
-          presentation: 'modal',
-        }}>
-        <Stack.Screen
-          name="Welcome"
-          component={Welcome}
-          options={{title: title('Welcome')}}
-        />
-        <Stack.Screen name="RecommendedFeeds" component={RecommendedFeeds} />
-      </Stack.Group>
+      <Stack.Screen
+        name="Welcome"
+        component={Welcome}
+        options={{
+          title: title('Welcome'),
+          presentation: 'card',
+          headerShown: true,
+          headerTransparent: true,
+          headerTitle: '',
+          headerBackVisible: false,
+          headerRight: props => <WelcomeHeaderRight {...props} />,
+        }}
+      />
+      <Stack.Screen
+        name="RecommendedFeeds"
+        component={RecommendedFeeds}
+        options={{
+          title: title('Recommended Feeds'),
+        }}
+      />
     </>
   )
 }
diff --git a/src/lib/analytics/types.ts b/src/lib/analytics/types.ts
index f876c6d53..d56e1b615 100644
--- a/src/lib/analytics/types.ts
+++ b/src/lib/analytics/types.ts
@@ -122,6 +122,7 @@ interface TrackPropertiesMap {
   // ONBOARDING events
   'Onboarding:Begin': {}
   'Onboarding:Complete': {}
+  'Onboarding:Skipped': {}
 }
 
 interface ScreenPropertiesMap {
diff --git a/src/state/models/discovery/onboarding.ts b/src/state/models/discovery/onboarding.ts
index 8e7a0a7b9..52521f578 100644
--- a/src/state/models/discovery/onboarding.ts
+++ b/src/state/models/discovery/onboarding.ts
@@ -1,12 +1,12 @@
 import {makeAutoObservable} from 'mobx'
 import {RootStoreModel} from '../root-store'
-import {NavigationProp} from 'lib/routes/types'
 import {hasProp} from 'lib/type-guards'
+import {track} from 'lib/analytics/analytics'
 
 export const OnboardingScreenSteps = {
   Welcome: 'Welcome',
   RecommendedFeeds: 'RecommendedFeeds',
-  Complete: 'Complete',
+  Home: 'Home',
 } as const
 
 type OnboardingStep =
@@ -34,6 +34,7 @@ export class OnboardingModel {
         typeof v.step === 'string' &&
         OnboardingStepsArray.includes(v.step as OnboardingStep)
       ) {
+        console.log('hydrating onboarding', v.step)
         this.step = v.step as OnboardingStep
       }
     }
@@ -41,31 +42,33 @@ export class OnboardingModel {
     this.reset()
   }
 
-  nextScreenName() {
-    if (this.step === 'Welcome') {
+  nextScreenName(currentScreenName?: OnboardingStep) {
+    if (currentScreenName === 'Welcome' || this.step === 'Welcome') {
       this.step = 'RecommendedFeeds'
       return this.step
-    } else if (this.step === 'RecommendedFeeds') {
-      this.step = 'Complete'
+    } else if (
+      this.step === 'RecommendedFeeds' ||
+      currentScreenName === 'RecommendedFeeds'
+    ) {
+      this.step = 'Home'
       return this.step
-    } else if (this.step === 'Complete') {
-      return 'Home'
     } else {
       // if we get here, we're in an invalid state, let's just go Home
       return 'Home'
     }
   }
 
-  complete(navigation: NavigationProp) {
-    navigation.navigate('Home')
-  }
-
   reset() {
     this.step = 'Welcome'
   }
 
+  skip() {
+    track('Onboarding:Skipped')
+    this.step = 'Home'
+  }
+
   get isComplete() {
-    return this.step === 'Complete'
+    return this.step === 'Home'
   }
 
   get isRemaining() {
diff --git a/src/view/com/auth/onboarding/RecommendedFeeds.tsx b/src/view/com/auth/onboarding/RecommendedFeeds.tsx
index 1936f4234..88fb200c6 100644
--- a/src/view/com/auth/onboarding/RecommendedFeeds.tsx
+++ b/src/view/com/auth/onboarding/RecommendedFeeds.tsx
@@ -1,5 +1,5 @@
 import React from 'react'
-import {StyleSheet, View} from 'react-native'
+import {FlatList, 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'
@@ -7,6 +7,117 @@ import {NativeStackScreenProps} from '@react-navigation/native-stack'
 import {HomeTabNavigatorParams} from 'lib/routes/types'
 import {useStores} from 'state/index'
 import {observer} from 'mobx-react-lite'
+import {CustomFeed} from 'view/com/feeds/CustomFeed'
+import {useCustomFeed} from 'lib/hooks/useCustomFeed'
+import {makeRecordUri} from 'lib/strings/url-helpers'
+import {ViewHeader} from 'view/com/util/ViewHeader'
+
+const TEMPORARY_RECOMMENDED_FEEDS = [
+  {
+    did: 'did:plc:hsqwcidfez66lwm3gxhfv5in',
+    rkey: 'aaaf2pqeodmpy',
+  },
+  {
+    did: 'did:plc:gekdk2nd47gkk3utfz2xf7cn',
+    rkey: 'aaap4tbjcfe5y',
+  },
+  {
+    did: 'did:plc:5rw2on4i56btlcajojaxwcat',
+    rkey: 'aaao6g552b33o',
+  },
+  {
+    did: 'did:plc:jfhpnnst6flqway4eaeqzj2a',
+    rkey: 'for-science',
+  },
+  {
+    did: 'did:plc:7q4nnnxawajbfaq7to5dpbsy',
+    rkey: 'bsky-news',
+  },
+  {
+    did: 'did:plc:jcoy7v3a2t4rcfdh6i4kza25',
+    rkey: 'astro',
+  },
+  {
+    did: 'did:plc:tenurhgjptubkk5zf5qhi3og',
+    rkey: 'h-nba',
+  },
+  {
+    did: 'did:plc:vpkhqolt662uhesyj6nxm7ys',
+    rkey: 'devfeed',
+  },
+  {
+    did: 'did:plc:cndfx4udwgvpjaakvxvh7wm5',
+    rkey: 'flipboard-tech',
+  },
+  {
+    did: 'did:plc:w4xbfzo7kqfes5zb7r6qv3rw',
+    rkey: 'blacksky',
+  },
+  {
+    did: 'did:plc:lptjvw6ut224kwrj7ub3sqbe',
+    rkey: 'aaaotfjzjplna',
+  },
+  {
+    did: 'did:plc:gkvpokm7ec5j5yxls6xk4e3z',
+    rkey: 'formula-one',
+  },
+  {
+    did: 'did:plc:q6gjnaw2blty4crticxkmujt',
+    rkey: 'positivifeed',
+  },
+  {
+    did: 'did:plc:l72uci4styb4jucsgcrrj5ap',
+    rkey: 'aaao5dzfm36u4',
+  },
+  {
+    did: 'did:plc:k3jkadxv5kkjgs6boyon7m6n',
+    rkey: 'aaaavlyvqzst2',
+  },
+  {
+    did: 'did:plc:nkahctfdi6bxk72umytfwghw',
+    rkey: 'aaado2uvfsc6w',
+  },
+  {
+    did: 'did:plc:epihigio3d7un7u3gpqiy5gv',
+    rkey: 'aaaekwsc7zsvs',
+  },
+  {
+    did: 'did:plc:qiknc4t5rq7yngvz7g4aezq7',
+    rkey: 'aaaejxlobe474',
+  },
+  {
+    did: 'did:plc:mlq4aycufcuolr7ax6sezpc4',
+    rkey: 'aaaoudweck6uy',
+  },
+  {
+    did: 'did:plc:rcez5hcvq3vzlu5x7xrjyccg',
+    rkey: 'aaadzjxbcddzi',
+  },
+  {
+    did: 'did:plc:lnxbuzaenlwjrncx6sc4cfdr',
+    rkey: 'aaab2vesjtszc',
+  },
+  {
+    did: 'did:plc:x3cya3wkt4n6u4ihmvpsc5if',
+    rkey: 'aaacynbxwimok',
+  },
+  {
+    did: 'did:plc:abv47bjgzjgoh3yrygwoi36x',
+    rkey: 'aaagt6amuur5e',
+  },
+  {
+    did: 'did:plc:ffkgesg3jsv2j7aagkzrtcvt',
+    rkey: 'aaacjerk7gwek',
+  },
+  {
+    did: 'did:plc:geoqe3qls5mwezckxxsewys2',
+    rkey: 'aaai43yetqshu',
+  },
+  {
+    did: 'did:plc:2wqomm3tjqbgktbrfwgvrw34',
+    rkey: 'authors',
+  },
+]
 
 type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'RecommendedFeeds'>
 export const RecommendedFeeds = observer(({navigation}: Props) => {
@@ -14,41 +125,68 @@ export const RecommendedFeeds = observer(({navigation}: Props) => {
   const store = useStores()
 
   const next = () => {
-    const nextScreenName = store.onboarding.nextScreenName()
+    const nextScreenName = store.onboarding.nextScreenName('RecommendedFeeds')
     if (nextScreenName) {
       navigation.navigate(nextScreenName)
     }
   }
 
   return (
-    <View style={[styles.container]}>
-      <View testID="recommendedFeedsScreen">
-        <Text type="lg-bold" style={[pal.text]}>
-          Check out some recommended feeds. Click + to add them to your list of
-          pinned feeds.
-        </Text>
-      </View>
+    <View style={[styles.container]} testID="recommendedFeedsScreen">
+      <ViewHeader title="Recommended Feeds" canGoBack />
+      <Text type="lg-medium" style={[pal.text, styles.header]}>
+        Check out some recommended feeds. Click + to add them to your list of
+        pinned feeds.
+      </Text>
+
+      <FlatList
+        data={TEMPORARY_RECOMMENDED_FEEDS}
+        renderItem={({item}) => <Item item={item} />}
+        keyExtractor={item => item.did + item.rkey}
+        style={{flex: 1}}
+      />
 
       <Button
         onPress={next}
         label="Continue"
         testID="continueBtn"
+        style={styles.button}
         labelStyle={styles.buttonText}
       />
     </View>
   )
 })
 
+type ItemProps = {
+  did: string
+  rkey: string
+}
+
+const Item = ({item}: {item: ItemProps}) => {
+  const uri = makeRecordUri(item.did, 'app.bsky.feed.generator', item.rkey)
+  const data = useCustomFeed(uri)
+  if (!data) return null
+  return (
+    <CustomFeed item={data} key={uri} showDescription showLikes showSaveBtn />
+  )
+}
+
 const styles = StyleSheet.create({
   container: {
     flex: 1,
-    marginVertical: 60,
     marginHorizontal: 16,
     justifyContent: 'space-between',
   },
+  header: {
+    marginBottom: 16,
+  },
+  button: {
+    marginBottom: 48,
+    marginTop: 16,
+  },
   buttonText: {
     textAlign: 'center',
     fontSize: 18,
-    marginVertical: 4,
+    paddingVertical: 4,
   },
 })
diff --git a/src/view/com/auth/onboarding/Welcome.tsx b/src/view/com/auth/onboarding/Welcome.tsx
index 5b663fe16..cb3a2307a 100644
--- a/src/view/com/auth/onboarding/Welcome.tsx
+++ b/src/view/com/auth/onboarding/Welcome.tsx
@@ -1,5 +1,5 @@
 import React from 'react'
-import {StyleSheet, View} from 'react-native'
+import {Pressable, StyleSheet, View} from 'react-native'
 import {Text} from 'view/com/util/text/Text'
 import {s} from 'lib/styles'
 import {usePalette} from 'lib/hooks/usePalette'
@@ -9,14 +9,23 @@ import {NativeStackScreenProps} from '@react-navigation/native-stack'
 import {HomeTabNavigatorParams} from 'lib/routes/types'
 import {useStores} from 'state/index'
 import {observer} from 'mobx-react-lite'
+import {HeaderButtonProps} from '@react-navigation/native-stack/lib/typescript/src/types'
+import {NavigationProp, useNavigation} from '@react-navigation/native'
 
 type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Welcome'>
 export const Welcome = observer(({navigation}: Props) => {
   const pal = usePalette('default')
   const store = useStores()
 
+  // make sure bottom nav is hidden
+  React.useEffect(() => {
+    if (!store.shell.minimalShellMode) {
+      store.shell.setMinimalShellMode(true)
+    }
+  }, [store.shell.minimalShellMode, store])
+
   const next = () => {
-    const nextScreenName = store.onboarding.nextScreenName()
+    const nextScreenName = store.onboarding.nextScreenName('Welcome')
     if (nextScreenName) {
       navigation.navigate(nextScreenName)
     }
@@ -76,6 +85,31 @@ export const Welcome = observer(({navigation}: Props) => {
   )
 })
 
+export const WelcomeHeaderRight = (props: HeaderButtonProps) => {
+  const {canGoBack} = props
+  const pal = usePalette('default')
+  const navigation = useNavigation<NavigationProp<HomeTabNavigatorParams>>()
+  const store = useStores()
+  return (
+    <Pressable
+      accessibilityRole="button"
+      style={[s.flexRow, s.alignCenter]}
+      onPress={() => {
+        if (canGoBack) {
+          store.onboarding.skip()
+          navigation.goBack()
+        }
+      }}>
+      <Text style={[pal.link]}>Skip</Text>
+      <FontAwesomeIcon
+        icon={'chevron-right'}
+        size={14}
+        color={pal.colors.link}
+      />
+    </Pressable>
+  )
+}
+
 const styles = StyleSheet.create({
   container: {
     flex: 1,
diff --git a/src/view/index.ts b/src/view/index.ts
index 1c3dc3937..2e4c08ec7 100644
--- a/src/view/index.ts
+++ b/src/view/index.ts
@@ -92,6 +92,7 @@ import {faPlay} from '@fortawesome/free-solid-svg-icons/faPlay'
 import {faPause} from '@fortawesome/free-solid-svg-icons/faPause'
 import {faThumbtack} from '@fortawesome/free-solid-svg-icons/faThumbtack'
 import {faList} from '@fortawesome/free-solid-svg-icons/faList'
+import {faChevronRight} from '@fortawesome/free-solid-svg-icons/faChevronRight'
 
 export function setup() {
   library.add(
@@ -187,5 +188,6 @@ export function setup() {
     faPlay,
     faPause,
     faList,
+    faChevronRight,
   )
 }
-- 
cgit 1.4.1


From bf37913701836091b3e902694d72d190eeca5ec9 Mon Sep 17 00:00:00 2001
From: Ansh Nanda <anshnanda10@gmail.com>
Date: Tue, 29 Aug 2023 12:16:26 -0700
Subject: fix onboarding on web

---
 src/Navigation.tsx                                | 14 ++--
 src/lib/hooks/useOnboarding.ts                    | 23 +++++++
 src/state/models/ui/shell.ts                      |  7 ++
 src/view/com/auth/onboarding/RecommendedFeeds.tsx | 34 +++++----
 src/view/com/auth/onboarding/Welcome.tsx          | 84 +++++++++--------------
 src/view/com/modals/Modal.web.tsx                 | 10 ++-
 src/view/com/modals/OnboardingModal.tsx           | 40 +++++++++++
 src/view/com/util/ViewHeader.tsx                  | 74 ++++++++++++--------
 src/view/screens/Home.tsx                         | 10 +--
 src/view/screens/onboarding/RecommendedFeeds.tsx  | 20 ++++++
 src/view/screens/onboarding/Welcome.tsx           | 32 +++++++++
 11 files changed, 235 insertions(+), 113 deletions(-)
 create mode 100644 src/lib/hooks/useOnboarding.ts
 create mode 100644 src/view/com/modals/OnboardingModal.tsx
 create mode 100644 src/view/screens/onboarding/RecommendedFeeds.tsx
 create mode 100644 src/view/screens/onboarding/Welcome.tsx

(limited to 'src/Navigation.tsx')

diff --git a/src/Navigation.tsx b/src/Navigation.tsx
index 058a15fa2..334370ab0 100644
--- a/src/Navigation.tsx
+++ b/src/Navigation.tsx
@@ -67,8 +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, WelcomeHeaderRight} from 'view/com/auth/onboarding/Welcome'
-import {RecommendedFeeds} from 'view/com/auth/onboarding/RecommendedFeeds'
+import {RecommendedFeedsScreen} from 'view/screens/onboarding/RecommendedFeeds'
+import {WelcomeScreen} from 'view/screens/onboarding/Welcome'
 
 const navigationRef = createNavigationContainerRef<AllNavigatorParams>()
 
@@ -223,20 +223,16 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
       />
       <Stack.Screen
         name="Welcome"
-        component={Welcome}
+        component={WelcomeScreen}
         options={{
           title: title('Welcome'),
           presentation: 'card',
-          headerShown: true,
-          headerTransparent: true,
-          headerTitle: '',
-          headerBackVisible: false,
-          headerRight: props => <WelcomeHeaderRight {...props} />,
+          gestureEnabled: false,
         }}
       />
       <Stack.Screen
         name="RecommendedFeeds"
-        component={RecommendedFeeds}
+        component={RecommendedFeedsScreen}
         options={{
           title: title('Recommended Feeds'),
         }}
diff --git a/src/lib/hooks/useOnboarding.ts b/src/lib/hooks/useOnboarding.ts
new file mode 100644
index 000000000..cdf24bc14
--- /dev/null
+++ b/src/lib/hooks/useOnboarding.ts
@@ -0,0 +1,23 @@
+import React from 'react'
+import {useStores} from 'state/index'
+import {useNavigation} from '@react-navigation/native'
+import {NavigationProp} from 'lib/routes/types'
+import {isNative, isWeb} from 'platform/detection'
+
+export function useOnboarding() {
+  const store = useStores()
+  const navigation = useNavigation<NavigationProp>()
+
+  React.useEffect(() => {
+    if (store.onboarding.isActive) {
+      if (isWeb) {
+        store.shell.openModal({name: 'onboarding'})
+        return
+      }
+      if (isNative) {
+        navigation.navigate('Welcome')
+        return
+      }
+    }
+  }, [store.onboarding.isActive, navigation, store.shell])
+}
diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts
index a64047f9f..4c36dfdc6 100644
--- a/src/state/models/ui/shell.ts
+++ b/src/state/models/ui/shell.ts
@@ -140,6 +140,10 @@ export interface PreferencesHomeFeed {
   name: 'preferences-home-feed'
 }
 
+export interface OnboardingModal {
+  name: 'onboarding'
+}
+
 export type Modal =
   // Account
   | AddAppPasswordModal
@@ -175,6 +179,9 @@ export type Modal =
   // Generic
   | ConfirmModal
 
+  // Onboarding (only used on web)
+  | OnboardingModal
+
 interface LightboxModel {}
 
 export class ProfileImageLightbox implements LightboxModel {
diff --git a/src/view/com/auth/onboarding/RecommendedFeeds.tsx b/src/view/com/auth/onboarding/RecommendedFeeds.tsx
index 2f4c63daf..fa9d69f98 100644
--- a/src/view/com/auth/onboarding/RecommendedFeeds.tsx
+++ b/src/view/com/auth/onboarding/RecommendedFeeds.tsx
@@ -3,14 +3,12 @@ import {FlatList, 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'
 import {CustomFeed} from 'view/com/feeds/CustomFeed'
 import {useCustomFeed} from 'lib/hooks/useCustomFeed'
 import {makeRecordUri} from 'lib/strings/url-helpers'
 import {ViewHeader} from 'view/com/util/ViewHeader'
+import {isDesktopWeb} from 'platform/detection'
 
 const TEMPORARY_RECOMMENDED_FEEDS = [
   {
@@ -119,21 +117,15 @@ const TEMPORARY_RECOMMENDED_FEEDS = [
   },
 ]
 
-type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'RecommendedFeeds'>
-export const RecommendedFeeds = observer(({navigation}: Props) => {
+type Props = {
+  next: () => void
+}
+export const RecommendedFeeds = observer(({next}: Props) => {
   const pal = usePalette('default')
-  const store = useStores()
-
-  const next = () => {
-    const nextScreenName = store.onboarding.next('RecommendedFeeds')
-    if (nextScreenName) {
-      navigation.navigate(nextScreenName)
-    }
-  }
 
   return (
     <View style={[styles.container]} testID="recommendedFeedsScreen">
-      <ViewHeader title="Recommended Feeds" canGoBack />
+      <ViewHeader title="Recommended Feeds" canGoBack={true} />
       <Text type="lg-medium" style={[pal.text, styles.header]}>
         Check out some recommended feeds. Click + to add them to your list of
         pinned feeds.
@@ -167,7 +159,19 @@ const Item = ({item}: {item: ItemProps}) => {
   const data = useCustomFeed(uri)
   if (!data) return null
   return (
-    <CustomFeed item={data} key={uri} showDescription showLikes showSaveBtn />
+    <CustomFeed
+      item={data}
+      key={uri}
+      showDescription
+      showLikes
+      showSaveBtn
+      style={[
+        {
+          // @ts-ignore
+          cursor: isDesktopWeb ? 'pointer' : 'auto',
+        },
+      ]}
+    />
   )
 }
 
diff --git a/src/view/com/auth/onboarding/Welcome.tsx b/src/view/com/auth/onboarding/Welcome.tsx
index a1e97a32f..a322e4d4f 100644
--- a/src/view/com/auth/onboarding/Welcome.tsx
+++ b/src/view/com/auth/onboarding/Welcome.tsx
@@ -5,40 +5,45 @@ import {s} from 'lib/styles'
 import {usePalette} from 'lib/hooks/usePalette'
 import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
 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'
-import {HeaderButtonProps} from '@react-navigation/native-stack/lib/typescript/src/types'
-import {NavigationProp, useNavigation} from '@react-navigation/native'
+import {ViewHeader} from 'view/com/util/ViewHeader'
+import {isDesktopWeb} from 'platform/detection'
 
-type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Welcome'>
-export const Welcome = observer(({navigation}: Props) => {
-  const pal = usePalette('default')
-  const store = useStores()
-
-  // make sure bottom nav is hidden
-  React.useEffect(() => {
-    if (!store.shell.minimalShellMode) {
-      store.shell.setMinimalShellMode(true)
-    }
-  }, [store.shell.minimalShellMode, store])
+type Props = {
+  next: () => void
+  skip: () => void
+}
 
-  const next = () => {
-    const nextScreenName = store.onboarding.next('Welcome')
-    if (nextScreenName) {
-      navigation.navigate(nextScreenName)
-    }
-  }
+export const Welcome = observer(({next, skip}: Props) => {
+  const pal = usePalette('default')
 
   return (
-    <View style={[styles.container]}>
-      <View testID="welcomeScreen">
+    <View style={[styles.container]} testID="welcomeOnboarding">
+      <ViewHeader
+        showOnDesktop
+        showBorder={false}
+        showBackButton={false}
+        title=""
+        renderButton={() => {
+          return (
+            <Pressable
+              accessibilityRole="button"
+              style={[s.flexRow, s.alignCenter]}
+              onPress={skip}>
+              <Text style={[pal.link]}>Skip</Text>
+              <FontAwesomeIcon
+                icon={'chevron-right'}
+                size={14}
+                color={pal.colors.link}
+              />
+            </Pressable>
+          )
+        }}
+      />
+      <View>
         <Text style={[pal.text, styles.title]}>Welcome to </Text>
         <Text style={[pal.text, pal.link, styles.title]}>Bluesky</Text>
-
         <View style={styles.spacer} />
-
         <View style={[styles.row]}>
           <FontAwesomeIcon icon={'globe'} size={36} color={pal.colors.link} />
           <View style={[styles.rowText]}>
@@ -85,35 +90,10 @@ export const Welcome = observer(({navigation}: Props) => {
   )
 })
 
-export const WelcomeHeaderRight = (props: HeaderButtonProps) => {
-  const {canGoBack} = props
-  const pal = usePalette('default')
-  const navigation = useNavigation<NavigationProp<HomeTabNavigatorParams>>()
-  const store = useStores()
-  return (
-    <Pressable
-      accessibilityRole="button"
-      style={[s.flexRow, s.alignCenter]}
-      onPress={() => {
-        if (canGoBack) {
-          store.onboarding.skip()
-          navigation.goBack()
-        }
-      }}>
-      <Text style={[pal.link]}>Skip</Text>
-      <FontAwesomeIcon
-        icon={'chevron-right'}
-        size={14}
-        color={pal.colors.link}
-      />
-    </Pressable>
-  )
-}
-
 const styles = StyleSheet.create({
   container: {
     flex: 1,
-    marginVertical: 60,
+    marginBottom: isDesktopWeb ? 30 : 60,
     marginHorizontal: 16,
     justifyContent: 'space-between',
   },
diff --git a/src/view/com/modals/Modal.web.tsx b/src/view/com/modals/Modal.web.tsx
index 6aef1b71c..20da99e81 100644
--- a/src/view/com/modals/Modal.web.tsx
+++ b/src/view/com/modals/Modal.web.tsx
@@ -27,7 +27,7 @@ import * as ContentFilteringSettingsModal from './ContentFilteringSettings'
 import * as ContentLanguagesSettingsModal from './lang-settings/ContentLanguagesSettings'
 import * as PostLanguagesSettingsModal from './lang-settings/PostLanguagesSettings'
 import * as ModerationDetailsModal from './ModerationDetails'
-
+import * as OnboardingModal from './OnboardingModal'
 import * as PreferencesHomeFeed from './PreferencesHomeFeed'
 
 export const ModalsContainer = observer(function ModalsContainer() {
@@ -55,7 +55,11 @@ function Modal({modal}: {modal: ModalIface}) {
   }
 
   const onPressMask = () => {
-    if (modal.name === 'crop-image' || modal.name === 'edit-image') {
+    if (
+      modal.name === 'crop-image' ||
+      modal.name === 'edit-image' ||
+      modal.name === 'onboarding'
+    ) {
       return // dont close on mask presses during crop
     }
     store.shell.closeModal()
@@ -110,6 +114,8 @@ function Modal({modal}: {modal: ModalIface}) {
     element = <PreferencesHomeFeed.Component />
   } else if (modal.name === 'moderation-details') {
     element = <ModerationDetailsModal.Component {...modal} />
+  } else if (modal.name === 'onboarding') {
+    element = <OnboardingModal.Component />
   } else {
     return null
   }
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',
+  },
+})
diff --git a/src/view/com/util/ViewHeader.tsx b/src/view/com/util/ViewHeader.tsx
index f5a921ac0..47e631072 100644
--- a/src/view/com/util/ViewHeader.tsx
+++ b/src/view/com/util/ViewHeader.tsx
@@ -17,6 +17,7 @@ const BACK_HITSLOP = {left: 20, top: 20, right: 50, bottom: 20}
 export const ViewHeader = observer(function ({
   title,
   canGoBack,
+  showBackButton = true,
   hideOnScroll,
   showOnDesktop,
   showBorder,
@@ -24,6 +25,7 @@ export const ViewHeader = observer(function ({
 }: {
   title: string
   canGoBack?: boolean
+  showBackButton?: boolean
   hideOnScroll?: boolean
   showOnDesktop?: boolean
   showBorder?: boolean
@@ -49,7 +51,13 @@ export const ViewHeader = observer(function ({
 
   if (isDesktopWeb) {
     if (showOnDesktop) {
-      return <DesktopWebHeader title={title} renderButton={renderButton} />
+      return (
+        <DesktopWebHeader
+          title={title}
+          renderButton={renderButton}
+          showBorder={showBorder}
+        />
+      )
     }
     return null
   } else {
@@ -59,30 +67,32 @@ export const ViewHeader = observer(function ({
 
     return (
       <Container hideOnScroll={hideOnScroll || false} showBorder={showBorder}>
-        <TouchableOpacity
-          testID="viewHeaderDrawerBtn"
-          onPress={canGoBack ? onPressBack : onPressMenu}
-          hitSlop={BACK_HITSLOP}
-          style={canGoBack ? styles.backBtn : styles.backBtnWide}
-          accessibilityRole="button"
-          accessibilityLabel={canGoBack ? 'Back' : 'Menu'}
-          accessibilityHint={
-            canGoBack ? '' : 'Access navigation links and settings'
-          }>
-          {canGoBack ? (
-            <FontAwesomeIcon
-              size={18}
-              icon="angle-left"
-              style={[styles.backIcon, pal.text]}
-            />
-          ) : (
-            <FontAwesomeIcon
-              size={18}
-              icon="bars"
-              style={[styles.backIcon, pal.textLight]}
-            />
-          )}
-        </TouchableOpacity>
+        {showBackButton ? (
+          <TouchableOpacity
+            testID="viewHeaderDrawerBtn"
+            onPress={canGoBack ? onPressBack : onPressMenu}
+            hitSlop={BACK_HITSLOP}
+            style={canGoBack ? styles.backBtn : styles.backBtnWide}
+            accessibilityRole="button"
+            accessibilityLabel={canGoBack ? 'Back' : 'Menu'}
+            accessibilityHint={
+              canGoBack ? '' : 'Access navigation links and settings'
+            }>
+            {canGoBack ? (
+              <FontAwesomeIcon
+                size={18}
+                icon="angle-left"
+                style={[styles.backIcon, pal.text]}
+              />
+            ) : (
+              <FontAwesomeIcon
+                size={18}
+                icon="bars"
+                style={[styles.backIcon, pal.textLight]}
+              />
+            )}
+          </TouchableOpacity>
+        ) : null}
         <View style={styles.titleContainer} pointerEvents="none">
           <Text type="title" style={[pal.text, styles.title]}>
             {title}
@@ -101,13 +111,23 @@ export const ViewHeader = observer(function ({
 function DesktopWebHeader({
   title,
   renderButton,
+  showBorder = true,
 }: {
   title: string
   renderButton?: () => JSX.Element
+  showBorder?: boolean
 }) {
   const pal = usePalette('default')
   return (
-    <CenteredView style={[styles.header, styles.desktopHeader, pal.border]}>
+    <CenteredView
+      style={[
+        styles.header,
+        styles.desktopHeader,
+        pal.border,
+        {
+          borderBottomWidth: showBorder ? 1 : 0,
+        },
+      ]}>
       <View style={styles.titleContainer} pointerEvents="none">
         <Text type="title-lg" style={[pal.text, styles.title]}>
           {title}
@@ -195,13 +215,11 @@ const styles = StyleSheet.create({
     width: '100%',
   },
   desktopHeader: {
-    borderBottomWidth: 1,
     paddingVertical: 12,
   },
   border: {
     borderBottomWidth: 1,
   },
-
   titleContainer: {
     marginLeft: 'auto',
     marginRight: 'auto',
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
index 7017c698c..4397200e4 100644
--- a/src/view/screens/Home.tsx
+++ b/src/view/screens/Home.tsx
@@ -21,6 +21,7 @@ import {useOnMainScroll} from 'lib/hooks/useOnMainScroll'
 import {useAnalytics} from 'lib/analytics/analytics'
 import {ComposeIcon2} from 'lib/icons'
 import {isDesktopWeb, isMobileWebMediaQuery, isWeb} from 'platform/detection'
+import {useOnboarding} from 'lib/hooks/useOnboarding'
 
 const HEADER_OFFSET_MOBILE = 78
 const HEADER_OFFSET_DESKTOP = 50
@@ -31,7 +32,7 @@ const POLL_FREQ = 30e3 // 30sec
 
 type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Home'>
 export const HomeScreen = withAuthRequired(
-  observer(({navigation}: Props) => {
+  observer(({}: Props) => {
     const store = useStores()
     const pagerRef = React.useRef<PagerRef>(null)
     const [selectedPage, setSelectedPage] = React.useState(0)
@@ -39,12 +40,7 @@ export const HomeScreen = withAuthRequired(
     const [requestedCustomFeeds, setRequestedCustomFeeds] = React.useState<
       string[]
     >([])
-
-    React.useEffect(() => {
-      if (store.onboarding.isActive) {
-        navigation.navigate('Welcome')
-      }
-    }, [store.onboarding.isActive, navigation])
+    useOnboarding()
 
     React.useEffect(() => {
       const {pinned} = store.me.savedFeeds
diff --git a/src/view/screens/onboarding/RecommendedFeeds.tsx b/src/view/screens/onboarding/RecommendedFeeds.tsx
new file mode 100644
index 000000000..d27278456
--- /dev/null
+++ b/src/view/screens/onboarding/RecommendedFeeds.tsx
@@ -0,0 +1,20 @@
+import React from 'react'
+import {NativeStackScreenProps} from '@react-navigation/native-stack'
+import {HomeTabNavigatorParams} from 'lib/routes/types'
+import {useStores} from 'state/index'
+import {observer} from 'mobx-react-lite'
+import {RecommendedFeeds} from 'view/com/auth/onboarding/RecommendedFeeds'
+
+type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'RecommendedFeeds'>
+export const RecommendedFeedsScreen = observer(({navigation}: Props) => {
+  const store = useStores()
+
+  const next = () => {
+    const nextScreenName = store.onboarding.next('RecommendedFeeds')
+    if (nextScreenName) {
+      navigation.navigate(nextScreenName)
+    }
+  }
+
+  return <RecommendedFeeds next={next} />
+})
diff --git a/src/view/screens/onboarding/Welcome.tsx b/src/view/screens/onboarding/Welcome.tsx
new file mode 100644
index 000000000..ea3e5ed77
--- /dev/null
+++ b/src/view/screens/onboarding/Welcome.tsx
@@ -0,0 +1,32 @@
+import React from 'react'
+import {NativeStackScreenProps} from '@react-navigation/native-stack'
+import {HomeTabNavigatorParams} from 'lib/routes/types'
+import {useStores} from 'state/index'
+import {observer} from 'mobx-react-lite'
+import {Welcome} from 'view/com/auth/onboarding/Welcome'
+
+type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Welcome'>
+export const WelcomeScreen = observer(({navigation}: Props) => {
+  const store = useStores()
+
+  // make sure bottom nav is hidden
+  React.useEffect(() => {
+    if (!store.shell.minimalShellMode) {
+      store.shell.setMinimalShellMode(true)
+    }
+  }, [store.shell.minimalShellMode, store])
+
+  const next = () => {
+    const nextScreenName = store.onboarding.next('Welcome')
+    if (nextScreenName) {
+      navigation.navigate(nextScreenName)
+    }
+  }
+
+  const skip = () => {
+    store.onboarding.skip()
+    navigation.navigate('Home')
+  }
+
+  return <Welcome next={next} skip={skip} />
+})
-- 
cgit 1.4.1


From 5d9534ca7258e6165e537b89d999a8c494501dc0 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Tue, 29 Aug 2023 20:20:51 -0700
Subject: Move onboarding to the withAuthRequired HOC

---
 src/Navigation.tsx                      | 18 ---------------
 src/lib/hooks/useOnboarding.ts          | 23 -------------------
 src/lib/routes/types.ts                 |  5 -----
 src/state/models/ui/shell.ts            |  7 ------
 src/view/com/auth/Onboarding.tsx        | 40 +++++++++++++++++++++++++++++++++
 src/view/com/auth/withAuthRequired.tsx  |  4 ++++
 src/view/com/modals/Modal.web.tsx       |  9 +-------
 src/view/com/modals/OnboardingModal.tsx | 40 ---------------------------------
 src/view/screens/Home.tsx               |  2 --
 9 files changed, 45 insertions(+), 103 deletions(-)
 delete mode 100644 src/lib/hooks/useOnboarding.ts
 create mode 100644 src/view/com/auth/Onboarding.tsx
 delete mode 100644 src/view/com/modals/OnboardingModal.tsx

(limited to 'src/Navigation.tsx')

diff --git a/src/Navigation.tsx b/src/Navigation.tsx
index 334370ab0..d45376ef1 100644
--- a/src/Navigation.tsx
+++ b/src/Navigation.tsx
@@ -67,8 +67,6 @@ import {getRoutingInstrumentation} from 'lib/sentry'
 import {bskyTitle} from 'lib/strings/headings'
 import {JSX} from 'react/jsx-runtime'
 import {timeout} from 'lib/async/timeout'
-import {RecommendedFeedsScreen} from 'view/screens/onboarding/RecommendedFeeds'
-import {WelcomeScreen} from 'view/screens/onboarding/Welcome'
 
 const navigationRef = createNavigationContainerRef<AllNavigatorParams>()
 
@@ -221,22 +219,6 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
         component={SavedFeeds}
         options={{title: title('Edit My Feeds')}}
       />
-      <Stack.Screen
-        name="Welcome"
-        component={WelcomeScreen}
-        options={{
-          title: title('Welcome'),
-          presentation: 'card',
-          gestureEnabled: false,
-        }}
-      />
-      <Stack.Screen
-        name="RecommendedFeeds"
-        component={RecommendedFeedsScreen}
-        options={{
-          title: title('Recommended Feeds'),
-        }}
-      />
     </>
   )
 }
diff --git a/src/lib/hooks/useOnboarding.ts b/src/lib/hooks/useOnboarding.ts
deleted file mode 100644
index cdf24bc14..000000000
--- a/src/lib/hooks/useOnboarding.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import React from 'react'
-import {useStores} from 'state/index'
-import {useNavigation} from '@react-navigation/native'
-import {NavigationProp} from 'lib/routes/types'
-import {isNative, isWeb} from 'platform/detection'
-
-export function useOnboarding() {
-  const store = useStores()
-  const navigation = useNavigation<NavigationProp>()
-
-  React.useEffect(() => {
-    if (store.onboarding.isActive) {
-      if (isWeb) {
-        store.shell.openModal({name: 'onboarding'})
-        return
-      }
-      if (isNative) {
-        navigation.navigate('Welcome')
-        return
-      }
-    }
-  }, [store.onboarding.isActive, navigation, store.shell])
-}
diff --git a/src/lib/routes/types.ts b/src/lib/routes/types.ts
index 633fa57a5..4eb5e29d2 100644
--- a/src/lib/routes/types.ts
+++ b/src/lib/routes/types.ts
@@ -1,6 +1,5 @@
 import {NavigationState, PartialState} from '@react-navigation/native'
 import type {NativeStackNavigationProp} from '@react-navigation/native-stack'
-import {OnboardingScreenSteps} from 'state/models/discovery/onboarding'
 
 export type {NativeStackScreenProps} from '@react-navigation/native-stack'
 
@@ -30,10 +29,6 @@ export type CommonNavigatorParams = {
   CopyrightPolicy: undefined
   AppPasswords: undefined
   SavedFeeds: undefined
-} & OnboardingScreenParams
-
-export type OnboardingScreenParams = {
-  [K in keyof typeof OnboardingScreenSteps]: undefined
 }
 
 export type BottomTabNavigatorParams = CommonNavigatorParams & {
diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts
index 4c36dfdc6..a64047f9f 100644
--- a/src/state/models/ui/shell.ts
+++ b/src/state/models/ui/shell.ts
@@ -140,10 +140,6 @@ export interface PreferencesHomeFeed {
   name: 'preferences-home-feed'
 }
 
-export interface OnboardingModal {
-  name: 'onboarding'
-}
-
 export type Modal =
   // Account
   | AddAppPasswordModal
@@ -179,9 +175,6 @@ export type Modal =
   // Generic
   | ConfirmModal
 
-  // Onboarding (only used on web)
-  | OnboardingModal
-
 interface LightboxModel {}
 
 export class ProfileImageLightbox implements LightboxModel {
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>
+  )
+})
diff --git a/src/view/com/auth/withAuthRequired.tsx b/src/view/com/auth/withAuthRequired.tsx
index 8e57669be..c81c2d5df 100644
--- a/src/view/com/auth/withAuthRequired.tsx
+++ b/src/view/com/auth/withAuthRequired.tsx
@@ -9,6 +9,7 @@ import {observer} from 'mobx-react-lite'
 import {useStores} from 'state/index'
 import {CenteredView} from '../util/Views'
 import {LoggedOut} from './LoggedOut'
+import {Onboarding} from './Onboarding'
 import {Text} from '../util/text/Text'
 import {usePalette} from 'lib/hooks/usePalette'
 import {STATUS_PAGE_URL} from 'lib/constants'
@@ -24,6 +25,9 @@ export const withAuthRequired = <P extends object>(
     if (!store.session.hasSession) {
       return <LoggedOut />
     }
+    if (store.onboarding.isActive) {
+      return <Onboarding />
+    }
     return <Component {...props} />
   })
 
diff --git a/src/view/com/modals/Modal.web.tsx b/src/view/com/modals/Modal.web.tsx
index 20da99e81..3aeddeb6b 100644
--- a/src/view/com/modals/Modal.web.tsx
+++ b/src/view/com/modals/Modal.web.tsx
@@ -27,7 +27,6 @@ import * as ContentFilteringSettingsModal from './ContentFilteringSettings'
 import * as ContentLanguagesSettingsModal from './lang-settings/ContentLanguagesSettings'
 import * as PostLanguagesSettingsModal from './lang-settings/PostLanguagesSettings'
 import * as ModerationDetailsModal from './ModerationDetails'
-import * as OnboardingModal from './OnboardingModal'
 import * as PreferencesHomeFeed from './PreferencesHomeFeed'
 
 export const ModalsContainer = observer(function ModalsContainer() {
@@ -55,11 +54,7 @@ function Modal({modal}: {modal: ModalIface}) {
   }
 
   const onPressMask = () => {
-    if (
-      modal.name === 'crop-image' ||
-      modal.name === 'edit-image' ||
-      modal.name === 'onboarding'
-    ) {
+    if (modal.name === 'crop-image' || modal.name === 'edit-image') {
       return // dont close on mask presses during crop
     }
     store.shell.closeModal()
@@ -114,8 +109,6 @@ function Modal({modal}: {modal: ModalIface}) {
     element = <PreferencesHomeFeed.Component />
   } else if (modal.name === 'moderation-details') {
     element = <ModerationDetailsModal.Component {...modal} />
-  } else if (modal.name === 'onboarding') {
-    element = <OnboardingModal.Component />
   } else {
     return null
   }
diff --git a/src/view/com/modals/OnboardingModal.tsx b/src/view/com/modals/OnboardingModal.tsx
deleted file mode 100644
index 3862736cf..000000000
--- a/src/view/com/modals/OnboardingModal.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-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',
-  },
-})
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
index 4397200e4..7262756d3 100644
--- a/src/view/screens/Home.tsx
+++ b/src/view/screens/Home.tsx
@@ -21,7 +21,6 @@ import {useOnMainScroll} from 'lib/hooks/useOnMainScroll'
 import {useAnalytics} from 'lib/analytics/analytics'
 import {ComposeIcon2} from 'lib/icons'
 import {isDesktopWeb, isMobileWebMediaQuery, isWeb} from 'platform/detection'
-import {useOnboarding} from 'lib/hooks/useOnboarding'
 
 const HEADER_OFFSET_MOBILE = 78
 const HEADER_OFFSET_DESKTOP = 50
@@ -40,7 +39,6 @@ export const HomeScreen = withAuthRequired(
     const [requestedCustomFeeds, setRequestedCustomFeeds] = React.useState<
       string[]
     >([])
-    useOnboarding()
 
     React.useEffect(() => {
       const {pinned} = store.me.savedFeeds
-- 
cgit 1.4.1

