Age Assurance V2 (#9479)
* Age Assurance V2 * Tighten up test * Add todos for sdk migration * Align RQ versions * Use useEffect for side effect * Improve effects, memoize * Standarize on birthdate * Copy feedback * Copilot * Add support link * Reove double .. * Cleanup * Remove redirect dialog * Cleanup todos, add comments * Update splash in main template too * Mock some stuff * Exhaustive checks Co-authored-by: Samuel Newman <mozzius@protonmail.com> * Exhaustive checks Co-authored-by: Samuel Newman <mozzius@protonmail.com> * Small fix to bday handling * Add comment * onboarding style tweak sneaking this in sorry! * rm unreachable breaks * Put useIntentHandler back on web * Remove misleading success set * Align on birthdate --------- Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
@@ -13,7 +13,6 @@ import {useNotificationsRegistration} from '#/lib/notifications/notifications'
|
||||
import {isStateAtTabRoot} from '#/lib/routes/helpers'
|
||||
import {isAndroid, isIOS} from '#/platform/detection'
|
||||
import {useDialogFullyExpandedCountContext} from '#/state/dialogs'
|
||||
import {useGeolocationStatus} from '#/state/geolocation'
|
||||
import {useSession} from '#/state/session'
|
||||
import {
|
||||
useIsDrawerOpen,
|
||||
@@ -27,7 +26,6 @@ import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||
import {atoms as a, select, useTheme} from '#/alf'
|
||||
import {setSystemUITheme} from '#/alf/util/systemUI'
|
||||
import {AgeAssuranceRedirectDialog} from '#/components/ageAssurance/AgeAssuranceRedirectDialog'
|
||||
import {BlockedGeoOverlay} from '#/components/BlockedGeoOverlay'
|
||||
import {EmailDialog} from '#/components/dialogs/EmailDialog'
|
||||
import {InAppBrowserConsentDialog} from '#/components/dialogs/InAppBrowserConsent'
|
||||
import {LinkWarningDialog} from '#/components/dialogs/LinkWarning'
|
||||
@@ -38,6 +36,9 @@ import {
|
||||
usePolicyUpdateContext,
|
||||
} from '#/components/PolicyUpdateOverlay'
|
||||
import {Outlet as PortalOutlet} from '#/components/Portal'
|
||||
import {useAgeAssurance} from '#/ageAssurance'
|
||||
import {NoAccessScreen} from '#/ageAssurance/components/NoAccessScreen'
|
||||
import {RedirectOverlay} from '#/ageAssurance/components/RedirectOverlay'
|
||||
import {RoutesContainer, TabsNavigator} from '#/Navigation'
|
||||
import {BottomSheetOutlet} from '../../../modules/bottom-sheet'
|
||||
import {updateActiveViewAsync} from '../../../modules/expo-bluesky-swiss-army/src/VisibilityView'
|
||||
@@ -193,7 +194,7 @@ function DrawerLayout({children}: {children: React.ReactNode}) {
|
||||
|
||||
export function Shell() {
|
||||
const t = useTheme()
|
||||
const {status: geolocation} = useGeolocationStatus()
|
||||
const aa = useAgeAssurance()
|
||||
const fullyExpandedCount = useDialogFullyExpandedCountContext()
|
||||
|
||||
useIntentHandler()
|
||||
@@ -213,13 +214,15 @@ export function Shell() {
|
||||
navigationBar: t.name !== 'light' ? 'light' : 'dark',
|
||||
}}
|
||||
/>
|
||||
{geolocation?.isAgeBlockedGeo ? (
|
||||
<BlockedGeoOverlay />
|
||||
{aa.state.access === aa.Access.None ? (
|
||||
<NoAccessScreen />
|
||||
) : (
|
||||
<RoutesContainer>
|
||||
<ShellInner />
|
||||
</RoutesContainer>
|
||||
)}
|
||||
|
||||
<RedirectOverlay />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ 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 {useGeolocationStatus} from '#/state/geolocation'
|
||||
import {useIsDrawerOpen, useSetDrawerOpen} from '#/state/shell'
|
||||
import {useComposerKeyboardShortcut} from '#/state/shell/composer/useComposerKeyboardShortcut'
|
||||
import {useCloseAllActiveElements} from '#/state/util'
|
||||
@@ -17,7 +16,6 @@ import {ModalsContainer} from '#/view/com/modals/Modal'
|
||||
import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||
import {atoms as a, select, useTheme} from '#/alf'
|
||||
import {AgeAssuranceRedirectDialog} from '#/components/ageAssurance/AgeAssuranceRedirectDialog'
|
||||
import {BlockedGeoOverlay} from '#/components/BlockedGeoOverlay'
|
||||
import {EmailDialog} from '#/components/dialogs/EmailDialog'
|
||||
import {LinkWarningDialog} from '#/components/dialogs/LinkWarning'
|
||||
import {MutedWordsDialog} from '#/components/dialogs/MutedWords'
|
||||
@@ -29,6 +27,9 @@ import {
|
||||
} from '#/components/PolicyUpdateOverlay'
|
||||
import {Outlet as PortalOutlet} from '#/components/Portal'
|
||||
import {WelcomeModal} from '#/components/WelcomeModal'
|
||||
import {useAgeAssurance} from '#/ageAssurance'
|
||||
import {NoAccessScreen} from '#/ageAssurance/components/NoAccessScreen'
|
||||
import {RedirectOverlay} from '#/ageAssurance/components/RedirectOverlay'
|
||||
import {FlatNavigator, RoutesContainer} from '#/Navigation'
|
||||
import {Composer} from './Composer.web'
|
||||
import {DrawerContent} from './Drawer'
|
||||
@@ -139,16 +140,18 @@ function ShellInner() {
|
||||
|
||||
export function Shell() {
|
||||
const t = useTheme()
|
||||
const {status: geolocation} = useGeolocationStatus()
|
||||
const aa = useAgeAssurance()
|
||||
return (
|
||||
<View style={[a.util_screen_outer, t.atoms.bg]}>
|
||||
{geolocation?.isAgeBlockedGeo ? (
|
||||
<BlockedGeoOverlay />
|
||||
{aa.state.access === aa.Access.None ? (
|
||||
<NoAccessScreen />
|
||||
) : (
|
||||
<RoutesContainer>
|
||||
<ShellInner />
|
||||
</RoutesContainer>
|
||||
)}
|
||||
|
||||
<RedirectOverlay />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user