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>
</View>
{declaredAge === undefined && (
<>
<Text
style={[
a.pt_2xl,
@@ -315,15 +317,6 @@ export function ModerationScreenInner({
<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]}>
{declaredAge === undefined && (
<>
<Button
label={_(msg`Confirm your birthdate`)}
size="small"
@@ -344,6 +337,28 @@ export function ModerationScreenInner({
<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
style={[
a.w_full,
@@ -351,7 +366,7 @@ export function ModerationScreenInner({
a.overflow_hidden,
t.atoms.bg_contrast_25,
]}>
{!isDeclaredUnderage && !isAgeRestricted && (
{!isDeclaredUnderage && (
<>
<View
style={[
@@ -367,7 +382,7 @@ export function ModerationScreenInner({
</Text>
<Toggle.Item
label={_(msg`Toggle to enable or disable adult content`)}
disabled={disabledOnIOS}
disabled={disabledOnIOS || isAgeRestricted}
name="adultContent"
value={adultContentEnabled}
onChange={onToggleAdultContentEnabled}>
@@ -403,10 +418,10 @@ export function ModerationScreenInner({
</Text>
</View>
)}
<Divider />
{adultContentEnabled && (
<>
<Divider />
<GlobalLabelPreference labelDefinition={LABELS.porn} />
<Divider />
<GlobalLabelPreference labelDefinition={LABELS.sexual} />
@@ -415,16 +430,18 @@ export function ModerationScreenInner({
labelDefinition={LABELS['graphic-media']}
/>
<Divider />
</>
)}
</>
)}
<GlobalLabelPreference
disabled={isDeclaredUnderage || isAgeRestricted}
labelDefinition={LABELS.nudity}
/>
</>
)}
</>
)}
</View>
</View>
</>
)}
<Text
style={[