Checkpoint: almost there
This commit is contained in:
@@ -20,11 +20,11 @@ import {createStaticClick, InlineLinkText} from '#/components/Link'
|
||||
import {Text} from '#/components/Typography'
|
||||
|
||||
export function AgeAssuranceAccountCard({style}: ViewStyleProp & {}) {
|
||||
const {isLoaded, mustCompleteAgeAssurance, isUnderage} = useAgeInfo()
|
||||
const {isLoaded, isAgeRestricted, isUnderage} = useAgeInfo()
|
||||
|
||||
if (!isLoaded) return null
|
||||
if (isUnderage) return null
|
||||
if (!mustCompleteAgeAssurance) return null
|
||||
if (!isAgeRestricted) return null
|
||||
|
||||
return <Inner style={style} />
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ export function AgeAssuranceAdmonition({
|
||||
style,
|
||||
}: ViewStyleProp & {children: React.ReactNode}) {
|
||||
const control = useDialogControl()
|
||||
const {isLoaded, isUnderage, mustCompleteAgeAssurance} = useAgeInfo()
|
||||
const {isLoaded, isUnderage, isAgeRestricted} = useAgeInfo()
|
||||
|
||||
if (!isLoaded) return null
|
||||
if (isUnderage) return null
|
||||
if (!mustCompleteAgeAssurance) return null
|
||||
if (!isAgeRestricted) return null
|
||||
|
||||
return (
|
||||
<Inner style={style} control={control}>
|
||||
|
||||
@@ -12,8 +12,7 @@ import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
|
||||
|
||||
export function AgeAssuranceDismissableNotice({style}: ViewStyleProp & {}) {
|
||||
const {_} = useLingui()
|
||||
const {isLoaded, isUnderage, mustCompleteAgeAssurance, assurance} =
|
||||
useAgeInfo()
|
||||
const {isLoaded, isUnderage, isAgeRestricted, assurance} = useAgeInfo()
|
||||
const {nux} = useNux(Nux.AgeAssuranceDismissableNotice)
|
||||
const copy = useAgeAssuranceCopy()
|
||||
const {mutate: save, variables} = useSaveNux()
|
||||
@@ -21,7 +20,7 @@ export function AgeAssuranceDismissableNotice({style}: ViewStyleProp & {}) {
|
||||
|
||||
if (!isLoaded) return null
|
||||
if (isUnderage) return null
|
||||
if (!mustCompleteAgeAssurance) return null
|
||||
if (!isAgeRestricted) return null
|
||||
if (assurance.lastInitiatedAt) return null
|
||||
if (hidden) return null
|
||||
if (nux && nux.completed) return null
|
||||
|
||||
@@ -24,7 +24,7 @@ export function AgeRestrictedScreen({
|
||||
}) {
|
||||
const {_} = useLingui()
|
||||
const copy = useAgeAssuranceCopy()
|
||||
const {isLoaded, mustCompleteAgeAssurance} = useAgeInfo()
|
||||
const {isLoaded, isAgeRestricted} = useAgeInfo()
|
||||
|
||||
if (!isLoaded) {
|
||||
return (
|
||||
@@ -39,7 +39,7 @@ export function AgeRestrictedScreen({
|
||||
</Layout.Screen>
|
||||
)
|
||||
}
|
||||
if (!mustCompleteAgeAssurance) return children
|
||||
if (!isAgeRestricted) return children
|
||||
|
||||
return (
|
||||
<Layout.Screen>
|
||||
|
||||
Reference in New Issue
Block a user