Fix space on bottom of mod screen

This commit is contained in:
Eric Bailey
2024-03-19 10:02:32 -05:00
parent 8ac5144a58
commit 851d13b24d
+224 -228
View File
@@ -205,19 +205,111 @@ export function ModerationScreenInner({
) )
return ( return (
<View> <ScrollView
<ScrollView contentContainerStyle={[
contentContainerStyle={[ a.border_0,
a.border_0, a.pt_2xl,
a.pt_2xl, a.px_lg,
a.px_lg, gtMobile && a.px_2xl,
gtMobile && a.px_2xl, ]}>
]}> <Text
<Text style={[a.text_md, a.font_bold, a.pb_md, t.atoms.text_contrast_high]}>
style={[a.text_md, a.font_bold, a.pb_md, t.atoms.text_contrast_high]}> <Trans>Moderation tools</Trans>
<Trans>Moderation tools</Trans> </Text>
</Text>
<View
style={[
a.w_full,
a.rounded_md,
a.overflow_hidden,
t.atoms.bg_contrast_25,
]}>
<Button
testID="mutedWordsBtn"
label={_(msg`Open muted words and tags settings`)}
onPress={() => mutedWordsDialogControl.open()}>
{state => (
<SubItem
title={_(msg`Muted words & tags`)}
icon={Filter}
style={[
(state.hovered || state.pressed) && [t.atoms.bg_contrast_50],
]}
/>
)}
</Button>
<Divider />
<Link testID="moderationlistsBtn" to="/moderation/modlists">
{state => (
<SubItem
title={_(msg`Moderation lists`)}
icon={Group}
style={[
(state.hovered || state.pressed) && [t.atoms.bg_contrast_50],
]}
/>
)}
</Link>
<Divider />
<Link testID="mutedAccountsBtn" to="/moderation/muted-accounts">
{state => (
<SubItem
title={_(msg`Muted accounts`)}
icon={Person}
style={[
(state.hovered || state.pressed) && [t.atoms.bg_contrast_50],
]}
/>
)}
</Link>
<Divider />
<Link testID="blockedAccountsBtn" to="/moderation/blocked-accounts">
{state => (
<SubItem
title={_(msg`Blocked accounts`)}
icon={CircleBanSign}
style={[
(state.hovered || state.pressed) && [t.atoms.bg_contrast_50],
]}
/>
)}
</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>
<View style={[a.gap_md]}>
{ageNotSet && (
<>
<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} />
</>
)}
<View <View
style={[ style={[
a.w_full, a.w_full,
@@ -225,231 +317,135 @@ export function ModerationScreenInner({
a.overflow_hidden, a.overflow_hidden,
t.atoms.bg_contrast_25, t.atoms.bg_contrast_25,
]}> ]}>
<Button {!ageNotSet && !isUnderage && (
testID="mutedWordsBtn"
label={_(msg`Open muted words and tags settings`)}
onPress={() => mutedWordsDialogControl.open()}>
{state => (
<SubItem
title={_(msg`Muted words & tags`)}
icon={Filter}
style={[
(state.hovered || state.pressed) && [t.atoms.bg_contrast_50],
]}
/>
)}
</Button>
<Divider />
<Link testID="moderationlistsBtn" to="/moderation/modlists">
{state => (
<SubItem
title={_(msg`Moderation lists`)}
icon={Group}
style={[
(state.hovered || state.pressed) && [t.atoms.bg_contrast_50],
]}
/>
)}
</Link>
<Divider />
<Link testID="mutedAccountsBtn" to="/moderation/muted-accounts">
{state => (
<SubItem
title={_(msg`Muted accounts`)}
icon={Person}
style={[
(state.hovered || state.pressed) && [t.atoms.bg_contrast_50],
]}
/>
)}
</Link>
<Divider />
<Link testID="blockedAccountsBtn" to="/moderation/blocked-accounts">
{state => (
<SubItem
title={_(msg`Blocked accounts`)}
icon={CircleBanSign}
style={[
(state.hovered || state.pressed) && [t.atoms.bg_contrast_50],
]}
/>
)}
</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>
<View style={[a.gap_md]}>
{ageNotSet && (
<> <>
<Button <View
label={_(msg`Confirm your birthdate`)} style={[
size="small" a.py_lg,
variant="solid" a.px_lg,
color="secondary" a.flex_row,
onPress={() => { a.align_center,
birthdateDialogControl.open() a.justify_between,
}} ]}>
style={[a.justify_between, a.rounded_md, a.px_lg, a.py_lg]}> <Text style={[a.font_semibold, t.atoms.text_contrast_high]}>
<ButtonText> <Trans>Enable adult content</Trans>
<Trans>Confirm your age:</Trans> </Text>
</ButtonText> <Toggle.Item
<ButtonText> label={_(msg`Toggle to enable or disable adult content`)}
<Trans>Set birthdate</Trans> name="adultContent"
</ButtonText> value={adultContentEnabled}
</Button> onChange={onToggleAdultContentEnabled}>
<View style={[a.flex_row, a.align_center, a.gap_sm]}>
<BirthDateSettingsDialog control={birthdateDialogControl} /> <Text style={[t.atoms.text_contrast_medium]}>
{adultContentEnabled ? (
<Trans>Enabled</Trans>
) : (
<Trans>Disabled</Trans>
)}
</Text>
<Toggle.Switch />
</View>
</Toggle.Item>
</View>
<Divider />
</> </>
)} )}
<View {!isUnderage && adultContentEnabled && (
style={[ <>
a.w_full, <GlobalModerationLabelPref labelValueDefinition={LABELS.porn} />
a.rounded_md, <Divider />
a.overflow_hidden, <GlobalModerationLabelPref labelValueDefinition={LABELS.sexual} />
t.atoms.bg_contrast_25, <Divider />
]}> <GlobalModerationLabelPref
{!ageNotSet && !isUnderage && ( labelValueDefinition={LABELS['graphic-media']}
<> />
<View <Divider />
style={[ </>
a.py_lg, )}
a.px_lg, <GlobalModerationLabelPref labelValueDefinition={LABELS.nudity} />
a.flex_row,
a.align_center,
a.justify_between,
]}>
<Text style={[a.font_semibold, t.atoms.text_contrast_high]}>
<Trans>Enable adult content</Trans>
</Text>
<Toggle.Item
label={_(msg`Toggle to enable or disable adult content`)}
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>
<Divider />
</>
)}
{!isUnderage && adultContentEnabled && (
<>
<GlobalModerationLabelPref labelValueDefinition={LABELS.porn} />
<Divider />
<GlobalModerationLabelPref
labelValueDefinition={LABELS.sexual}
/>
<Divider />
<GlobalModerationLabelPref
labelValueDefinition={LABELS['graphic-media']}
/>
<Divider />
</>
)}
<GlobalModerationLabelPref labelValueDefinition={LABELS.nudity} />
</View>
</View> </View>
</View>
<Text <Text
style={[ style={[
a.text_md, a.text_md,
a.font_bold, a.font_bold,
a.pt_2xl, a.pt_2xl,
a.pb_md, a.pb_md,
t.atoms.text_contrast_high, t.atoms.text_contrast_high,
]}> ]}>
<Trans>Advanced</Trans> <Trans>Advanced</Trans>
</Text> </Text>
{isLabelersLoading ? ( {isLabelersLoading ? (
<Loader /> <Loader />
) : labelersError || !labelers ? ( ) : labelersError || !labelers ? (
<View style={[a.p_lg, a.rounded_sm, t.atoms.bg_contrast_25]}> <View style={[a.p_lg, a.rounded_sm, t.atoms.bg_contrast_25]}>
<Text> <Text>
<Trans> <Trans>
We were unable to load your configured labelers at this time. We were unable to load your configured labelers at this time.
</Trans> </Trans>
</Text> </Text>
</View> </View>
) : ( ) : (
<View style={[a.rounded_sm, t.atoms.bg_contrast_25]}> <View style={[a.rounded_sm, t.atoms.bg_contrast_25]}>
{labelers.map((labeler, i) => { {labelers.map((labeler, i) => {
return ( return (
<React.Fragment key={labeler.creator.did}> <React.Fragment key={labeler.creator.did}>
{i !== 0 && <Divider />} {i !== 0 && <Divider />}
<LabelingService.Link labeler={labeler}> <LabelingService.Link labeler={labeler}>
{state => ( {state => (
<LabelingService.Outer <LabelingService.Outer
style={[ style={[
i === 0 && { i === 0 && {
borderTopLeftRadius: a.rounded_sm.borderRadius, borderTopLeftRadius: a.rounded_sm.borderRadius,
borderTopRightRadius: a.rounded_sm.borderRadius, borderTopRightRadius: a.rounded_sm.borderRadius,
}, },
i === labelers.length - 1 && { i === labelers.length - 1 && {
borderBottomLeftRadius: a.rounded_sm.borderRadius, borderBottomLeftRadius: a.rounded_sm.borderRadius,
borderBottomRightRadius: a.rounded_sm.borderRadius, borderBottomRightRadius: a.rounded_sm.borderRadius,
}, },
(state.hovered || state.pressed) && [ (state.hovered || state.pressed) && [
t.atoms.bg_contrast_50, t.atoms.bg_contrast_50,
], ],
]}> ]}>
<LabelingService.Avatar /> <LabelingService.Avatar />
<LabelingService.Content> <LabelingService.Content>
<LabelingService.Title <LabelingService.Title
value={getLabelingServiceTitle({ value={getLabelingServiceTitle({
displayName: labeler.creator.displayName, displayName: labeler.creator.displayName,
handle: labeler.creator.handle, handle: labeler.creator.handle,
})} })}
/> />
<LabelingService.Description <LabelingService.Description
value={labeler.creator.description} value={labeler.creator.description}
handle={labeler.creator.handle} handle={labeler.creator.handle}
/> />
</LabelingService.Content> </LabelingService.Content>
</LabelingService.Outer> </LabelingService.Outer>
)} )}
</LabelingService.Link> </LabelingService.Link>
</React.Fragment> </React.Fragment>
) )
})} })}
</View> </View>
)} )}
<Text <Text
style={[ style={[
a.text_md, a.text_md,
a.font_bold, a.font_bold,
a.pt_2xl, a.pt_2xl,
a.pb_md, a.pb_md,
t.atoms.text_contrast_high, t.atoms.text_contrast_high,
]}> ]}>
<Trans>Logged-out visibility</Trans> <Trans>Logged-out visibility</Trans>
</Text> </Text>
<PwiOptOut /> <PwiOptOut />
<View style={{height: 200}} /> <View style={{height: 200}} />
</ScrollView> </ScrollView>
</View>
) )
} }