: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={_( 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={[
@@ -138,17 +138,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
+9 -9
View File
@@ -294,14 +294,12 @@ let FeedItemInner = ({
</View> </View>
)} )}
<LabelsOnMyPost post={post} /> <LabelsOnMyPost post={post} />
<View style={[a.pb_sm]}> <PostContent
<PostContent moderation={moderation}
moderation={moderation} richText={richText}
richText={richText} postEmbed={post.embed}
postEmbed={post.embed} postAuthor={post.author}
postAuthor={post.author} />
/>
</View>
<PostCtrls <PostCtrls
post={post} post={post}
record={record} record={record}
@@ -364,7 +362,9 @@ let PostContent = ({
/> />
) : undefined} ) : undefined}
{postEmbed ? ( {postEmbed ? (
<PostEmbeds embed={postEmbed} moderation={moderation} /> <View style={[a.pb_sm]}>
<PostEmbeds embed={postEmbed} moderation={moderation} />
</View>
) : null} ) : null}
</ContentHider> </ContentHider>
) )