fix onboarding on web
This commit is contained in:
parent
742440c22d
commit
bf37913701
11 changed files with 235 additions and 113 deletions
|
@ -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
|
||||
}
|
||||
|
|
40
src/view/com/modals/OnboardingModal.tsx
Normal file
40
src/view/com/modals/OnboardingModal.tsx
Normal file
|
@ -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',
|
||||
},
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue