Design tweaks to ContentHider and ModDetailsDialog
This commit is contained in:
@@ -61,7 +61,11 @@ export function ContentHider({
|
|||||||
}}
|
}}
|
||||||
label={desc.name}
|
label={desc.name}
|
||||||
accessibilityHint={
|
accessibilityHint={
|
||||||
override ? _(msg`Hide the content`) : _(msg`Show the content`)
|
modui.noOverride
|
||||||
|
? _(msg`Learn more about the moderation applied to this content.`)
|
||||||
|
: override
|
||||||
|
? _(msg`Hide the content`)
|
||||||
|
: _(msg`Show the content`)
|
||||||
}>
|
}>
|
||||||
{state => (
|
{state => (
|
||||||
<View
|
<View
|
||||||
@@ -119,7 +123,9 @@ export function ContentHider({
|
|||||||
onPress={() => {
|
onPress={() => {
|
||||||
control.open()
|
control.open()
|
||||||
}}
|
}}
|
||||||
label={_(msg`Learn more`)}
|
label={_(
|
||||||
|
msg`Learn more about the moderation applied to this content.`,
|
||||||
|
)}
|
||||||
style={[a.pt_sm]}>
|
style={[a.pt_sm]}>
|
||||||
{state => (
|
{state => (
|
||||||
<Text
|
<Text
|
||||||
@@ -127,6 +133,7 @@ export function ContentHider({
|
|||||||
a.flex_1,
|
a.flex_1,
|
||||||
a.text_sm,
|
a.text_sm,
|
||||||
a.font_normal,
|
a.font_normal,
|
||||||
|
a.leading_snug,
|
||||||
t.atoms.text_contrast_medium,
|
t.atoms.text_contrast_medium,
|
||||||
a.text_left,
|
a.text_left,
|
||||||
]}>
|
]}>
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import {ModerationCause} from '@atproto/api'
|
|||||||
import {listUriToHref} from '#/lib/strings/url-helpers'
|
import {listUriToHref} from '#/lib/strings/url-helpers'
|
||||||
import {useModerationCauseDescription} from '#/lib/moderation/useModerationCauseDescription'
|
import {useModerationCauseDescription} from '#/lib/moderation/useModerationCauseDescription'
|
||||||
|
|
||||||
import {useTheme, atoms as a, useBreakpoints} from '#/alf'
|
import {isNative} from '#/platform/detection'
|
||||||
|
import {useTheme, atoms as a} from '#/alf'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
import {Button} from '#/components/Button'
|
|
||||||
import {InlineLink} from '#/components/Link'
|
import {InlineLink} from '#/components/Link'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
|
|
||||||
@@ -39,7 +39,6 @@ function ModerationDetailsDialogInner({
|
|||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const desc = useModerationCauseDescription(modcause)
|
const desc = useModerationCauseDescription(modcause)
|
||||||
const {gtMobile} = useBreakpoints()
|
|
||||||
|
|
||||||
let name
|
let name
|
||||||
let description
|
let description
|
||||||
@@ -110,28 +109,16 @@ function ModerationDetailsDialogInner({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner label={_(msg`Moderation details`)}>
|
||||||
accessibilityDescribedBy="dialog-description"
|
<Text style={[t.atoms.text, a.text_2xl, a.font_bold, a.mb_sm]}>
|
||||||
accessibilityLabelledBy="dialog-title">
|
|
||||||
<Text
|
|
||||||
nativeID="dialog-title"
|
|
||||||
style={[t.atoms.text, a.text_2xl, a.font_bold, a.mb_md]}>
|
|
||||||
{name}
|
{name}
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text style={[t.atoms.text, a.text_md, a.mb_md, a.leading_snug]}>
|
||||||
nativeID="dialog-description"
|
|
||||||
style={[t.atoms.text, a.text_md, a.mb_md]}>
|
|
||||||
{description}
|
{description}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{modcause.type === 'label' && (
|
{modcause.type === 'label' && (
|
||||||
<View
|
<View style={[t.atoms.bg_contrast_25, a.px_lg, a.py_lg, a.rounded_sm]}>
|
||||||
style={[
|
|
||||||
t.atoms.bg_contrast_50,
|
|
||||||
a.mb_md,
|
|
||||||
a.px_lg,
|
|
||||||
a.py_lg,
|
|
||||||
a.rounded_sm,
|
|
||||||
]}>
|
|
||||||
<Text style={[t.atoms.text, a.text_sm, a.leading_snug]}>
|
<Text style={[t.atoms.text, a.text_sm, a.leading_snug]}>
|
||||||
<Trans>
|
<Trans>
|
||||||
This label was applied by{' '}
|
This label was applied by{' '}
|
||||||
@@ -145,17 +132,10 @@ function ModerationDetailsDialogInner({
|
|||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
<View style={gtMobile && [a.flex_row, a.justify_end]}>
|
|
||||||
<Button
|
{isNative && <View style={{height: 40}} />}
|
||||||
testID="doneBtn"
|
|
||||||
variant="outline"
|
<Dialog.Close />
|
||||||
color="primary"
|
|
||||||
size="small"
|
|
||||||
onPress={() => control.close()}
|
|
||||||
label={_(msg`Done`)}>
|
|
||||||
{_(msg`Done`)}
|
|
||||||
</Button>
|
|
||||||
</View>
|
|
||||||
</Dialog.ScrollableInner>
|
</Dialog.ScrollableInner>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user