Hide mod settings if underage or age restricted

This commit is contained in:
Eric Bailey
2025-07-16 18:33:28 -05:00
parent b025f107d4
commit c9e1161688
+33 -16
View File
@@ -304,6 +304,8 @@ export function ModerationScreenInner({
</Link> </Link>
</View> </View>
{declaredAge === undefined && (
<>
<Text <Text
style={[ style={[
a.pt_2xl, a.pt_2xl,
@@ -315,15 +317,6 @@ export function ModerationScreenInner({
<Trans>Content filters</Trans> <Trans>Content filters</Trans>
</Text> </Text>
<AgeAssuranceAdmonition style={[a.pb_md]}>
<Trans>
You must complete age assurance in order to access the settings below.
</Trans>
</AgeAssuranceAdmonition>
<View style={[a.gap_md]}>
{declaredAge === undefined && (
<>
<Button <Button
label={_(msg`Confirm your birthdate`)} label={_(msg`Confirm your birthdate`)}
size="small" size="small"
@@ -344,6 +337,28 @@ export function ModerationScreenInner({
<BirthDateSettingsDialog control={birthdateDialogControl} /> <BirthDateSettingsDialog control={birthdateDialogControl} />
</> </>
)} )}
{!isDeclaredUnderage && (
<>
<Text
style={[
a.pt_2xl,
a.pb_md,
a.text_md,
a.font_bold,
t.atoms.text_contrast_high,
]}>
<Trans>Content filters</Trans>
</Text>
<AgeAssuranceAdmonition style={[a.pb_md]}>
<Trans>
You must complete age assurance in order to access the settings
below.
</Trans>
</AgeAssuranceAdmonition>
<View style={[a.gap_md]}>
<View <View
style={[ style={[
a.w_full, a.w_full,
@@ -351,7 +366,7 @@ export function ModerationScreenInner({
a.overflow_hidden, a.overflow_hidden,
t.atoms.bg_contrast_25, t.atoms.bg_contrast_25,
]}> ]}>
{!isDeclaredUnderage && !isAgeRestricted && ( {!isDeclaredUnderage && (
<> <>
<View <View
style={[ style={[
@@ -367,7 +382,7 @@ export function ModerationScreenInner({
</Text> </Text>
<Toggle.Item <Toggle.Item
label={_(msg`Toggle to enable or disable adult content`)} label={_(msg`Toggle to enable or disable adult content`)}
disabled={disabledOnIOS} disabled={disabledOnIOS || isAgeRestricted}
name="adultContent" name="adultContent"
value={adultContentEnabled} value={adultContentEnabled}
onChange={onToggleAdultContentEnabled}> onChange={onToggleAdultContentEnabled}>
@@ -403,10 +418,10 @@ export function ModerationScreenInner({
</Text> </Text>
</View> </View>
)} )}
<Divider />
{adultContentEnabled && ( {adultContentEnabled && (
<> <>
<Divider />
<GlobalLabelPreference labelDefinition={LABELS.porn} /> <GlobalLabelPreference labelDefinition={LABELS.porn} />
<Divider /> <Divider />
<GlobalLabelPreference labelDefinition={LABELS.sexual} /> <GlobalLabelPreference labelDefinition={LABELS.sexual} />
@@ -415,16 +430,18 @@ export function ModerationScreenInner({
labelDefinition={LABELS['graphic-media']} labelDefinition={LABELS['graphic-media']}
/> />
<Divider /> <Divider />
</>
)}
</>
)}
<GlobalLabelPreference <GlobalLabelPreference
disabled={isDeclaredUnderage || isAgeRestricted} disabled={isDeclaredUnderage || isAgeRestricted}
labelDefinition={LABELS.nudity} labelDefinition={LABELS.nudity}
/> />
</>
)}
</>
)}
</View> </View>
</View> </View>
</>
)}
<Text <Text
style={[ style={[