Fix types and remove dead code
parent
8ed6e72ea4
commit
3fa9b6daba
|
@ -5,19 +5,12 @@ 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 {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()
|
||||
|
|
|
@ -5,7 +5,7 @@ import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle'
|
|||
|
||||
interface Props {
|
||||
testID?: string
|
||||
title: React.Component
|
||||
title: JSX.Element
|
||||
horizontal: boolean
|
||||
titleStyle?: StyleProp<ViewStyle>
|
||||
contentStyle?: StyleProp<ViewStyle>
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
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} />
|
||||
})
|
|
@ -1,32 +0,0 @@
|
|||
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} />
|
||||
})
|
Loading…
Reference in New Issue