Handle self labels
This commit is contained in:
@@ -125,7 +125,7 @@ export function ContentHider({
|
|||||||
label={_(
|
label={_(
|
||||||
msg`Learn more about the moderation applied to this content.`,
|
msg`Learn more about the moderation applied to this content.`,
|
||||||
)}
|
)}
|
||||||
style={[a.pt_xs]}>
|
style={[a.pt_sm]}>
|
||||||
{state => (
|
{state => (
|
||||||
<Text
|
<Text
|
||||||
style={[
|
style={[
|
||||||
@@ -136,17 +136,19 @@ export function ContentHider({
|
|||||||
t.atoms.text_contrast_medium,
|
t.atoms.text_contrast_medium,
|
||||||
a.text_left,
|
a.text_left,
|
||||||
]}>
|
]}>
|
||||||
<Trans>
|
{desc.sourceType === 'user' ? (
|
||||||
Labeled by {sanitizeDisplayName(desc.source!)}.{' '}
|
<Trans>Labeled by the author.</Trans>
|
||||||
<Text
|
) : (
|
||||||
style={[
|
<Trans>Labeled by {sanitizeDisplayName(desc.source!)}.</Trans>
|
||||||
{color: t.palette.primary_500},
|
)}{' '}
|
||||||
a.text_sm,
|
<Text
|
||||||
state.hovered && [web({textDecoration: 'underline'})],
|
style={[
|
||||||
]}>
|
{color: t.palette.primary_500},
|
||||||
Learn more.
|
a.text_sm,
|
||||||
</Text>
|
state.hovered && [web({textDecoration: 'underline'})],
|
||||||
</Trans>
|
]}>
|
||||||
|
<Trans>Learn more.</Trans>
|
||||||
|
</Text>
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -124,12 +124,16 @@ function ModerationDetailsDialogInner({
|
|||||||
<Text style={[t.atoms.text, a.text_md, a.leading_snug, a.mt_lg]}>
|
<Text style={[t.atoms.text, a.text_md, a.leading_snug, a.mt_lg]}>
|
||||||
<Trans>
|
<Trans>
|
||||||
This label was applied by{' '}
|
This label was applied by{' '}
|
||||||
<InlineLink
|
{modcause.source.type === 'user' ? (
|
||||||
to={makeProfileLink({did: modcause.label.src, handle: ''})}
|
'the author'
|
||||||
onPress={() => control.close()}
|
) : (
|
||||||
style={a.text_md}>
|
<InlineLink
|
||||||
@{desc.source}
|
to={makeProfileLink({did: modcause.label.src, handle: ''})}
|
||||||
</InlineLink>
|
onPress={() => control.close()}
|
||||||
|
style={a.text_md}>
|
||||||
|
@{desc.source}
|
||||||
|
</InlineLink>
|
||||||
|
)}
|
||||||
.
|
.
|
||||||
</Trans>
|
</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {ModerationCause} from '@atproto/api'
|
import {ModerationCause, ModerationCauseSource} from '@atproto/api'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useGlobalLabelStrings} from './useGlobalLabelStrings'
|
import {useGlobalLabelStrings} from './useGlobalLabelStrings'
|
||||||
@@ -16,6 +16,7 @@ export interface ModerationCauseDescription {
|
|||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
source?: string
|
source?: string
|
||||||
|
sourceType?: ModerationCauseSource['type']
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useModerationCauseDescription(
|
export function useModerationCauseDescription(
|
||||||
@@ -114,7 +115,11 @@ export function useModerationCauseDescription(
|
|||||||
: CircleInfo,
|
: CircleInfo,
|
||||||
name: strings.name,
|
name: strings.name,
|
||||||
description: strings.description,
|
description: strings.description,
|
||||||
source: labeler?.creator.displayName || labeler?.creator.handle,
|
source:
|
||||||
|
labeler?.creator.displayName ||
|
||||||
|
(labeler?.creator.handle ? '@' + labeler?.creator.handle : undefined) ||
|
||||||
|
cause.label.src,
|
||||||
|
sourceType: cause.source.type,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// should never happen
|
// should never happen
|
||||||
|
|||||||
Reference in New Issue
Block a user