:erge branch '3p-moderators' of github.com:bluesky-social/social-app into 3p-moderators

This commit is contained in:
Paul Frazee
2024-03-13 14:26:46 -07:00
4 changed files with 40 additions and 29 deletions
+14 -12
View File
@@ -127,7 +127,7 @@ export function ContentHider({
label={_(
msg`Learn more about the moderation applied to this content.`,
)}
style={[a.pt_xs]}>
style={[a.pt_sm]}>
{state => (
<Text
style={[
@@ -138,17 +138,19 @@ export function ContentHider({
t.atoms.text_contrast_medium,
a.text_left,
]}>
<Trans>
Labeled by {sanitizeDisplayName(desc.source!)}.{' '}
<Text
style={[
{color: t.palette.primary_500},
a.text_sm,
state.hovered && [web({textDecoration: 'underline'})],
]}>
Learn more.
</Text>
</Trans>
{desc.sourceType === 'user' ? (
<Trans>Labeled by the author.</Trans>
) : (
<Trans>Labeled by {sanitizeDisplayName(desc.source!)}.</Trans>
)}{' '}
<Text
style={[
{color: t.palette.primary_500},
a.text_sm,
state.hovered && [web({textDecoration: 'underline'})],
]}>
<Trans>Learn more.</Trans>
</Text>
</Text>
)}
</Button>
@@ -124,12 +124,16 @@ function ModerationDetailsDialogInner({
<Text style={[t.atoms.text, a.text_md, a.leading_snug, a.mt_lg]}>
<Trans>
This label was applied by{' '}
<InlineLink
to={makeProfileLink({did: modcause.label.src, handle: ''})}
onPress={() => control.close()}
style={a.text_md}>
@{desc.source}
</InlineLink>
{modcause.source.type === 'user' ? (
'the author'
) : (
<InlineLink
to={makeProfileLink({did: modcause.label.src, handle: ''})}
onPress={() => control.close()}
style={a.text_md}>
@{desc.source}
</InlineLink>
)}
.
</Trans>
</Text>
@@ -1,4 +1,4 @@
import {ModerationCause} from '@atproto/api'
import {ModerationCause, ModerationCauseSource} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useGlobalLabelStrings} from './useGlobalLabelStrings'
@@ -16,6 +16,7 @@ export interface ModerationCauseDescription {
name: string
description: string
source?: string
sourceType?: ModerationCauseSource['type']
}
export function useModerationCauseDescription(
@@ -114,7 +115,11 @@ export function useModerationCauseDescription(
: CircleInfo,
name: strings.name,
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
+9 -9
View File
@@ -294,14 +294,12 @@ let FeedItemInner = ({
</View>
)}
<LabelsOnMyPost post={post} />
<View style={[a.pb_sm]}>
<PostContent
moderation={moderation}
richText={richText}
postEmbed={post.embed}
postAuthor={post.author}
/>
</View>
<PostContent
moderation={moderation}
richText={richText}
postEmbed={post.embed}
postAuthor={post.author}
/>
<PostCtrls
post={post}
record={record}
@@ -364,7 +362,9 @@ let PostContent = ({
/>
) : undefined}
{postEmbed ? (
<PostEmbeds embed={postEmbed} moderation={moderation} />
<View style={[a.pb_sm]}>
<PostEmbeds embed={postEmbed} moderation={moderation} />
</View>
) : null}
</ContentHider>
)