Fixes to the adult content age-gating in moderaiton

This commit is contained in:
Paul Frazee
2024-03-09 15:27:09 -08:00
parent 0bd52704da
commit e0f93cb9e6
2 changed files with 85 additions and 111 deletions
+1 -3
View File
@@ -44,9 +44,7 @@ export function useGlobalLabelStrings(): GlobalLabelStrings {
}, },
'graphic-media': { 'graphic-media': {
name: _(msg`Graphic Media`), name: _(msg`Graphic Media`),
description: _( description: _(msg`Explicit or potentially disturbing media.`),
msg`Explicit or potentially disturbing media, including graphic violence, severe injuries, or other visuals that may be shocking or upsetting to some viewers.`,
),
}, },
}), }),
[_], [_],
+19 -43
View File
@@ -283,8 +283,6 @@ export function ModerationScreenInner({
</Link> </Link>
</View> </View>
{ageNotSet || !isUnderage ? (
<>
<Text <Text
style={[ style={[
a.pt_2xl, a.pt_2xl,
@@ -297,39 +295,24 @@ export function ModerationScreenInner({
</Text> </Text>
<View style={[a.gap_md]}> <View style={[a.gap_md]}>
{ageNotSet ? ( {ageNotSet && (
<>
<View
style={[
a.w_full,
a.rounded_md,
a.overflow_hidden,
t.atoms.bg_contrast_25,
a.py_md,
a.px_lg,
a.flex_row,
a.align_center,
a.justify_between,
]}>
<Text style={[a.text_md, t.atoms.text_contrast_high]}>
<Trans>Confirm your age:</Trans>
</Text>
<Button <Button
label={_(msg`Confirm your birthdate`)} label={_(msg`Confirm your birthdate`)}
size="small" size="small"
variant="solid" variant="solid"
color="secondary" color="tertiary"
onPress={() => { onPress={() => {
openModal({name: 'birth-date-settings'}) openModal({name: 'birth-date-settings'})
}}> }}
style={[a.justify_between, a.rounded_md, a.px_lg, a.py_lg]}>
<ButtonText>
<Trans>Confirm your age:</Trans>
</ButtonText>
<ButtonText> <ButtonText>
<Trans>Set birthdate</Trans> <Trans>Set birthdate</Trans>
</ButtonText> </ButtonText>
</Button> </Button>
</View> )}
</>
) : (
<>
<View <View
style={[ style={[
a.w_full, a.w_full,
@@ -337,6 +320,8 @@ export function ModerationScreenInner({
a.overflow_hidden, a.overflow_hidden,
t.atoms.bg_contrast_25, t.atoms.bg_contrast_25,
]}> ]}>
{!ageNotSet && !isUnderage && (
<>
<View <View
style={[ style={[
a.py_lg, a.py_lg,
@@ -345,14 +330,11 @@ export function ModerationScreenInner({
a.align_center, a.align_center,
a.justify_between, a.justify_between,
]}> ]}>
<Text <Text style={[a.font_semibold, t.atoms.text_contrast_high]}>
style={[a.font_semibold, t.atoms.text_contrast_high]}>
<Trans>Enable adult content</Trans> <Trans>Enable adult content</Trans>
</Text> </Text>
<Toggle.Item <Toggle.Item
label={_( label={_(msg`Toggle to enable or disable adult content`)}
msg`Toggle to enable or disable adult content`,
)}
name="adultContent" name="adultContent"
value={adultContentEnabled} value={adultContentEnabled}
onChange={onToggleAdultContentEnabled}> onChange={onToggleAdultContentEnabled}>
@@ -368,12 +350,12 @@ export function ModerationScreenInner({
</View> </View>
</Toggle.Item> </Toggle.Item>
</View> </View>
{adultContentEnabled && (
<>
<Divider /> <Divider />
<GlobalModerationLabelPref </>
labelValueDefinition={LABELS.porn} )}
/> {!isUnderage && adultContentEnabled && (
<>
<GlobalModerationLabelPref labelValueDefinition={LABELS.porn} />
<Divider /> <Divider />
<GlobalModerationLabelPref <GlobalModerationLabelPref
labelValueDefinition={LABELS.sexual} labelValueDefinition={LABELS.sexual}
@@ -382,18 +364,12 @@ export function ModerationScreenInner({
<GlobalModerationLabelPref <GlobalModerationLabelPref
labelValueDefinition={LABELS['graphic-media']} labelValueDefinition={LABELS['graphic-media']}
/> />
</>
)}
<Divider /> <Divider />
<GlobalModerationLabelPref
labelValueDefinition={LABELS.nudity}
/>
</View>
</> </>
)} )}
<GlobalModerationLabelPref labelValueDefinition={LABELS.nudity} />
</View>
</View> </View>
</>
) : null}
<Text <Text
style={[ style={[