Move Takendown and Deactivated screens out to the shell alongside AA (#9538)
This commit is contained in:
@@ -35,10 +35,8 @@ import {
|
||||
useLoggedOutViewControls,
|
||||
} from '#/state/shell/logged-out'
|
||||
import {LoggedOut} from '#/view/com/auth/LoggedOut'
|
||||
import {Deactivated} from '#/screens/Deactivated'
|
||||
import {Onboarding} from '#/screens/Onboarding'
|
||||
import {SignupQueued} from '#/screens/SignupQueued'
|
||||
import {Takendown} from '#/screens/Takendown'
|
||||
import {atoms as a, useLayoutBreakpoints} from '#/alf'
|
||||
import {PolicyUpdateOverlay} from '#/components/PolicyUpdateOverlay'
|
||||
import {BottomBarWeb} from './bottom-bar/BottomBarWeb'
|
||||
@@ -119,15 +117,9 @@ function NativeStackNavigator({
|
||||
if (hasSession && currentAccount?.signupQueued) {
|
||||
return <SignupQueued />
|
||||
}
|
||||
if (hasSession && currentAccount?.status === 'takendown') {
|
||||
return <Takendown />
|
||||
}
|
||||
if (showLoggedOut) {
|
||||
return <LoggedOut onDismiss={() => setShowLoggedOut(false)} />
|
||||
}
|
||||
if (currentAccount?.status === 'deactivated') {
|
||||
return <Deactivated />
|
||||
}
|
||||
if (onboardingState.isActive) {
|
||||
return <Onboarding />
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import {useCloseAnyActiveElement} from '#/state/util'
|
||||
import {Lightbox} from '#/view/com/lightbox/Lightbox'
|
||||
import {ModalsContainer} from '#/view/com/modals/Modal'
|
||||
import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||
import {Deactivated} from '#/screens/Deactivated'
|
||||
import {Takendown} from '#/screens/Takendown'
|
||||
import {atoms as a, select, useTheme} from '#/alf'
|
||||
import {setSystemUITheme} from '#/alf/util/systemUI'
|
||||
import {AgeAssuranceRedirectDialog} from '#/components/ageAssurance/AgeAssuranceRedirectDialog'
|
||||
@@ -195,6 +197,7 @@ function DrawerLayout({children}: {children: React.ReactNode}) {
|
||||
export function Shell() {
|
||||
const t = useTheme()
|
||||
const aa = useAgeAssurance()
|
||||
const {currentAccount} = useSession()
|
||||
const fullyExpandedCount = useDialogFullyExpandedCountContext()
|
||||
|
||||
useIntentHandler()
|
||||
@@ -214,15 +217,23 @@ export function Shell() {
|
||||
navigationBar: t.name !== 'light' ? 'light' : 'dark',
|
||||
}}
|
||||
/>
|
||||
{aa.state.access === aa.Access.None ? (
|
||||
<NoAccessScreen />
|
||||
{currentAccount?.status === 'takendown' ? (
|
||||
<Takendown />
|
||||
) : currentAccount?.status === 'deactivated' ? (
|
||||
<Deactivated />
|
||||
) : (
|
||||
<RoutesContainer>
|
||||
<ShellInner />
|
||||
</RoutesContainer>
|
||||
)}
|
||||
<>
|
||||
{aa.state.access === aa.Access.None ? (
|
||||
<NoAccessScreen />
|
||||
) : (
|
||||
<RoutesContainer>
|
||||
<ShellInner />
|
||||
</RoutesContainer>
|
||||
)}
|
||||
|
||||
<RedirectOverlay />
|
||||
<RedirectOverlay />
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,12 +8,15 @@ import {RemoveScrollBar} from 'react-remove-scroll-bar'
|
||||
import {useIntentHandler} from '#/lib/hooks/useIntentHandler'
|
||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||
import {type NavigationProp} from '#/lib/routes/types'
|
||||
import {useSession} from '#/state/session'
|
||||
import {useIsDrawerOpen, useSetDrawerOpen} from '#/state/shell'
|
||||
import {useComposerKeyboardShortcut} from '#/state/shell/composer/useComposerKeyboardShortcut'
|
||||
import {useCloseAllActiveElements} from '#/state/util'
|
||||
import {Lightbox} from '#/view/com/lightbox/Lightbox'
|
||||
import {ModalsContainer} from '#/view/com/modals/Modal'
|
||||
import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||
import {Deactivated} from '#/screens/Deactivated'
|
||||
import {Takendown} from '#/screens/Takendown'
|
||||
import {atoms as a, select, useTheme} from '#/alf'
|
||||
import {AgeAssuranceRedirectDialog} from '#/components/ageAssurance/AgeAssuranceRedirectDialog'
|
||||
import {EmailDialog} from '#/components/dialogs/EmailDialog'
|
||||
@@ -141,17 +144,26 @@ function ShellInner() {
|
||||
export function Shell() {
|
||||
const t = useTheme()
|
||||
const aa = useAgeAssurance()
|
||||
const {currentAccount} = useSession()
|
||||
return (
|
||||
<View style={[a.util_screen_outer, t.atoms.bg]}>
|
||||
{aa.state.access === aa.Access.None ? (
|
||||
<NoAccessScreen />
|
||||
{currentAccount?.status === 'takendown' ? (
|
||||
<Takendown />
|
||||
) : currentAccount?.status === 'deactivated' ? (
|
||||
<Deactivated />
|
||||
) : (
|
||||
<RoutesContainer>
|
||||
<ShellInner />
|
||||
</RoutesContainer>
|
||||
)}
|
||||
<>
|
||||
{aa.state.access === aa.Access.None ? (
|
||||
<NoAccessScreen />
|
||||
) : (
|
||||
<RoutesContainer>
|
||||
<ShellInner />
|
||||
</RoutesContainer>
|
||||
)}
|
||||
|
||||
<RedirectOverlay />
|
||||
<RedirectOverlay />
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user