···22import {msg} from '@lingui/macro'
33import {useLingui} from '@lingui/react'
4455-import {useAgeAssurance} from '#/ageAssurance'
66-75export function useAgeAssuranceCopy() {
86 const {_} = useLingui()
99- const aa = useAgeAssurance()
107118 return useMemo(() => {
129 return {
1313- notice:
1414- aa.state.access === aa.Access.Safe
1515- ? _(
1616- msg`Due to laws in your region, certain features on Bluesky are currently restricted until you're able to verify you're an adult.`,
1717- )
1818- : _(
1919- msg`The laws in your location require you to verify you're an adult before accessing certain features on Bluesky, like adult content and direct messaging.`,
2020- ),
1010+ notice: _(
1111+ msg`Due to laws in your region, certain features on Bluesky are currently restricted until you're able to verify you're an adult.`,
1212+ ),
2113 banner: _(
2214 msg`The laws in your location require you to verify you're an adult to access certain features. Tap to learn more.`,
2315 ),
···2517 msg`Don't worry! All existing messages and settings are saved and will be available after you verify you're an adult.`,
2618 ),
2719 }
2828- }, [_, aa])
2020+ }, [_])
2921}
+35-9
src/screens/Moderation/index.tsx
···1212} from '#/lib/routes/types'
1313import {logger} from '#/logger'
1414import {isIOS} from '#/platform/detection'
1515+import {useIsBirthdateUpdateAllowed} from '#/state/birthdate'
1516import {
1617 useMyLabelersQuery,
1718 usePreferencesQuery,
···2122import {isNonConfigurableModerationAuthority} from '#/state/session/additional-moderation-authorities'
2223import {useSetMinimalShellMode} from '#/state/shell'
2324import {atoms as a, useBreakpoints, useTheme, type ViewStyleProp} from '#/alf'
2525+import {Admonition} from '#/components/Admonition'
2426import {AgeAssuranceAdmonition} from '#/components/ageAssurance/AgeAssuranceAdmonition'
2727+import {useAgeAssuranceCopy} from '#/components/ageAssurance/useAgeAssuranceCopy'
2528import {Button} from '#/components/Button'
2629import {useGlobalDialogsControlContext} from '#/components/dialogs/Context'
2730import {Divider} from '#/components/Divider'
···164167 error: labelersError,
165168 } = useMyLabelersQuery()
166169 const aa = useAgeAssurance()
170170+ const isBirthdateUpdateAllowed = useIsBirthdateUpdateAllowed()
171171+ const aaCopy = useAgeAssuranceCopy()
167172168173 useFocusEffect(
169174 useCallback(() => {
···173178174179 const {mutateAsync: setAdultContentPref, variables: optimisticAdultContent} =
175180 usePreferencesSetAdultContentMutation()
176176- const adultContentEnabled = !!(
181181+ let adultContentEnabled = !!(
177182 (optimisticAdultContent && optimisticAdultContent.enabled) ||
178183 (!optimisticAdultContent && preferences.moderationPrefs.adultContentEnabled)
179184 )
185185+ const adultContentUIDisabledOnIOS = isIOS && !adultContentEnabled
186186+ let adultContentUIDisabled = adultContentUIDisabledOnIOS
187187+188188+ if (aa.flags.adultContentDisabled) {
189189+ adultContentEnabled = false
190190+ adultContentUIDisabled = true
191191+ }
180192181193 const onToggleAdultContentEnabled = useCallback(
182194 async (selected: boolean) => {
···193205 [setAdultContentPref],
194206 )
195207196196- const disabledOnIOS = isIOS && !adultContentEnabled
197197-198208 return (
199209 <View style={[a.pt_2xl, a.px_lg, gtMobile && a.px_2xl]}>
210210+ {aa.flags.adultContentDisabled && isBirthdateUpdateAllowed && (
211211+ <View style={[a.pb_2xl]}>
212212+ <Admonition type="tip" style={[a.pb_md]}>
213213+ <Trans>
214214+ Your declared age is under 18. Some settings below may be
215215+ disabled. If this was a mistake, you may edit your birthdate in
216216+ your{' '}
217217+ <InlineLinkText
218218+ to="/settings/account"
219219+ label={_(msg`Go to account settings`)}>
220220+ account settings
221221+ </InlineLinkText>
222222+ .
223223+ </Trans>
224224+ </Admonition>
225225+ </View>
226226+ )}
227227+200228 <Text
201229 style={[
202230 a.text_md,
···317345 </Text>
318346319347 <AgeAssuranceAdmonition style={[a.pb_md]}>
320320- <Trans>
321321- You must complete age assurance in order to access content filters.
322322- </Trans>
348348+ {aaCopy.notice}
323349 </AgeAssuranceAdmonition>
324350325351 <View style={[a.gap_md]}>
···339365 a.flex_row,
340366 a.align_center,
341367 a.justify_between,
342342- disabledOnIOS && {opacity: 0.5},
368368+ adultContentUIDisabled && {opacity: 0.5},
343369 ]}>
344370 <Text style={[a.font_semi_bold, t.atoms.text_contrast_high]}>
345371 <Trans>Enable adult content</Trans>
346372 </Text>
347373 <Toggle.Item
348374 label={_(msg`Toggle to enable or disable adult content`)}
349349- disabled={disabledOnIOS}
375375+ disabled={adultContentUIDisabled}
350376 name="adultContent"
351377 value={adultContentEnabled}
352378 onChange={onToggleAdultContentEnabled}>
···362388 </View>
363389 </Toggle.Item>
364390 </View>
365365- {disabledOnIOS && (
391391+ {adultContentUIDisabledOnIOS && (
366392 <View style={[a.pb_lg, a.px_lg]}>
367393 <Text>
368394 <Trans>