diff options
Diffstat (limited to 'src/screens/Moderation/index.tsx')
-rw-r--r-- | src/screens/Moderation/index.tsx | 243 |
1 files changed, 130 insertions, 113 deletions
diff --git a/src/screens/Moderation/index.tsx b/src/screens/Moderation/index.tsx index a7b434e52..1517792a1 100644 --- a/src/screens/Moderation/index.tsx +++ b/src/screens/Moderation/index.tsx @@ -304,127 +304,144 @@ export function ModerationScreenInner({ </Link> </View> - <Text - style={[ - a.pt_2xl, - a.pb_md, - a.text_md, - a.font_bold, - t.atoms.text_contrast_high, - ]}> - <Trans>Content filters</Trans> - </Text> + {declaredAge === undefined && ( + <> + <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> + <Button + label={_(msg`Confirm your birthdate`)} + size="small" + variant="solid" + color="secondary" + onPress={() => { + birthdateDialogControl.open() + }} + style={[a.justify_between, a.rounded_md, a.px_lg, a.py_lg]}> + <ButtonText> + <Trans>Confirm your age:</Trans> + </ButtonText> + <ButtonText> + <Trans>Set birthdate</Trans> + </ButtonText> + </Button> - <View style={[a.gap_md]}> - {declaredAge === undefined && ( - <> - <Button - label={_(msg`Confirm your birthdate`)} - size="small" - variant="solid" - color="secondary" - onPress={() => { - birthdateDialogControl.open() - }} - style={[a.justify_between, a.rounded_md, a.px_lg, a.py_lg]}> - <ButtonText> - <Trans>Confirm your age:</Trans> - </ButtonText> - <ButtonText> - <Trans>Set birthdate</Trans> - </ButtonText> - </Button> + <BirthDateSettingsDialog control={birthdateDialogControl} /> + </> + )} - <BirthDateSettingsDialog control={birthdateDialogControl} /> - </> - )} - <View - style={[ - a.w_full, - a.rounded_md, - a.overflow_hidden, - t.atoms.bg_contrast_25, - ]}> - {!isDeclaredUnderage && !isAgeRestricted && ( - <> - <View - style={[ - a.py_lg, - a.px_lg, - a.flex_row, - a.align_center, - a.justify_between, - disabledOnIOS && {opacity: 0.5}, - ]}> - <Text style={[a.font_bold, t.atoms.text_contrast_high]}> - <Trans>Enable adult content</Trans> - </Text> - <Toggle.Item - label={_(msg`Toggle to enable or disable adult content`)} - disabled={disabledOnIOS} - name="adultContent" - value={adultContentEnabled} - onChange={onToggleAdultContentEnabled}> - <View style={[a.flex_row, a.align_center, a.gap_sm]}> - <Text style={[t.atoms.text_contrast_medium]}> - {adultContentEnabled ? ( - <Trans>Enabled</Trans> - ) : ( - <Trans>Disabled</Trans> - )} + {!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, + a.rounded_md, + a.overflow_hidden, + t.atoms.bg_contrast_25, + ]}> + {!isDeclaredUnderage && ( + <> + <View + style={[ + a.py_lg, + a.px_lg, + a.flex_row, + a.align_center, + a.justify_between, + disabledOnIOS && {opacity: 0.5}, + ]}> + <Text style={[a.font_bold, t.atoms.text_contrast_high]}> + <Trans>Enable adult content</Trans> </Text> - <Toggle.Switch /> + <Toggle.Item + label={_(msg`Toggle to enable or disable adult content`)} + disabled={disabledOnIOS || isAgeRestricted} + name="adultContent" + value={adultContentEnabled} + onChange={onToggleAdultContentEnabled}> + <View style={[a.flex_row, a.align_center, a.gap_sm]}> + <Text style={[t.atoms.text_contrast_medium]}> + {adultContentEnabled ? ( + <Trans>Enabled</Trans> + ) : ( + <Trans>Disabled</Trans> + )} + </Text> + <Toggle.Switch /> + </View> + </Toggle.Item> </View> - </Toggle.Item> - </View> - {disabledOnIOS && ( - <View style={[a.pb_lg, a.px_lg]}> - <Text> - <Trans> - Adult content can only be enabled via the Web at{' '} - <InlineLinkText - label={_(msg`The Bluesky web application`)} - to="" - onPress={evt => { - evt.preventDefault() - Linking.openURL('https://bsky.app/') - return false - }}> - bsky.app - </InlineLinkText> - . - </Trans> - </Text> - </View> - )} - <Divider /> + {disabledOnIOS && ( + <View style={[a.pb_lg, a.px_lg]}> + <Text> + <Trans> + Adult content can only be enabled via the Web at{' '} + <InlineLinkText + label={_(msg`The Bluesky web application`)} + to="" + onPress={evt => { + evt.preventDefault() + Linking.openURL('https://bsky.app/') + return false + }}> + bsky.app + </InlineLinkText> + . + </Trans> + </Text> + </View> + )} - {adultContentEnabled && ( - <> - <GlobalLabelPreference labelDefinition={LABELS.porn} /> - <Divider /> - <GlobalLabelPreference labelDefinition={LABELS.sexual} /> - <Divider /> - <GlobalLabelPreference - labelDefinition={LABELS['graphic-media']} - /> - <Divider /> + {adultContentEnabled && ( + <> + <Divider /> + <GlobalLabelPreference labelDefinition={LABELS.porn} /> + <Divider /> + <GlobalLabelPreference labelDefinition={LABELS.sexual} /> + <Divider /> + <GlobalLabelPreference + labelDefinition={LABELS['graphic-media']} + /> + <Divider /> + <GlobalLabelPreference + disabled={isDeclaredUnderage || isAgeRestricted} + labelDefinition={LABELS.nudity} + /> + </> + )} </> )} - </> - )} - <GlobalLabelPreference - disabled={isDeclaredUnderage || isAgeRestricted} - labelDefinition={LABELS.nudity} - /> - </View> - </View> + </View> + </View> + </> + )} <Text style={[ |