[🐴] Switch back to encouraging users to report messages (#4117)
* Swap prompt back in * Remove unused convoAccount affordances
This commit is contained in:
parent
cc7a0da1a2
commit
d0bfe703d9
7 changed files with 39 additions and 63 deletions
|
@ -58,9 +58,6 @@ export function SelectReportOptionView({
|
||||||
} else if (props.params.type === 'convoMessage') {
|
} else if (props.params.type === 'convoMessage') {
|
||||||
title = _(msg`Report this message`)
|
title = _(msg`Report this message`)
|
||||||
description = _(msg`Why should this message be reviewed?`)
|
description = _(msg`Why should this message be reviewed?`)
|
||||||
} else if (props.params.type === 'convoAccount') {
|
|
||||||
title = _(msg`Report this account`)
|
|
||||||
description = _(msg`Why should this account be reviewed?`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -13,5 +13,4 @@ export type ReportDialogProps = {
|
||||||
did: string
|
did: string
|
||||||
}
|
}
|
||||||
| {type: 'convoMessage'}
|
| {type: 'convoMessage'}
|
||||||
| {type: 'convoAccount'}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import * as Toast from '#/view/com/util/Toast'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog'
|
import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog'
|
||||||
import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt'
|
import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt'
|
||||||
import {ReportDialog} from '#/components/dms/ReportDialog'
|
import {ReportConversationPrompt} from '#/components/dms/ReportConversationPrompt'
|
||||||
import {ArrowBoxLeft_Stroke2_Corner0_Rounded as ArrowBoxLeft} from '#/components/icons/ArrowBoxLeft'
|
import {ArrowBoxLeft_Stroke2_Corner0_Rounded as ArrowBoxLeft} from '#/components/icons/ArrowBoxLeft'
|
||||||
import {DotGrid_Stroke2_Corner0_Rounded as DotsHorizontal} from '#/components/icons/DotGrid'
|
import {DotGrid_Stroke2_Corner0_Rounded as DotsHorizontal} from '#/components/icons/DotGrid'
|
||||||
import {Flag_Stroke2_Corner0_Rounded as Flag} from '#/components/icons/Flag'
|
import {Flag_Stroke2_Corner0_Rounded as Flag} from '#/components/icons/Flag'
|
||||||
|
@ -205,10 +205,7 @@ let ConvoMenu = ({
|
||||||
convoId={convo.id}
|
convoId={convo.id}
|
||||||
currentScreen={currentScreen}
|
currentScreen={currentScreen}
|
||||||
/>
|
/>
|
||||||
<ReportDialog
|
<ReportConversationPrompt control={reportControl} />
|
||||||
control={reportControl}
|
|
||||||
params={{type: 'convoAccount', did: profile.did, convoId: convo.id}}
|
|
||||||
/>
|
|
||||||
<BlockedByListDialog
|
<BlockedByListDialog
|
||||||
control={blockedByListControl}
|
control={blockedByListControl}
|
||||||
listBlocks={listBlocks}
|
listBlocks={listBlocks}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {useDialogControl} from '#/components/Dialog'
|
||||||
import {Divider} from '#/components/Divider'
|
import {Divider} from '#/components/Divider'
|
||||||
import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog'
|
import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog'
|
||||||
import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt'
|
import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt'
|
||||||
import {ReportDialog} from '#/components/dms/ReportDialog'
|
import {ReportConversationPrompt} from '#/components/dms/ReportConversationPrompt'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
export function MessagesListBlockedFooter({
|
export function MessagesListBlockedFooter({
|
||||||
|
@ -120,10 +120,7 @@ export function MessagesListBlockedFooter({
|
||||||
convoId={convoId}
|
convoId={convoId}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ReportDialog
|
<ReportConversationPrompt control={reportControl} />
|
||||||
control={reportControl}
|
|
||||||
params={{type: 'convoAccount', did: recipient.did, convoId}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<BlockedByListDialog
|
<BlockedByListDialog
|
||||||
control={blockedByListControl}
|
control={blockedByListControl}
|
||||||
|
|
27
src/components/dms/ReportConversationPrompt.tsx
Normal file
27
src/components/dms/ReportConversationPrompt.tsx
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
import React from 'react'
|
||||||
|
import {msg} from '@lingui/macro'
|
||||||
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {DialogControlProps} from '#/components/Dialog'
|
||||||
|
import * as Prompt from '#/components/Prompt'
|
||||||
|
|
||||||
|
export function ReportConversationPrompt({
|
||||||
|
control,
|
||||||
|
}: {
|
||||||
|
control: DialogControlProps
|
||||||
|
}) {
|
||||||
|
const {_} = useLingui()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Prompt.Basic
|
||||||
|
control={control}
|
||||||
|
title={_(msg`Report conversation`)}
|
||||||
|
description={_(
|
||||||
|
msg`To report a conversation, please report one of its messages via the conversation screen. This lets our moderators understand the context of your issue.`,
|
||||||
|
)}
|
||||||
|
confirmButtonCta={_(msg`I understand`)}
|
||||||
|
onConfirm={() => {}}
|
||||||
|
showCancel={false}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
|
@ -25,13 +25,7 @@ import {RichText} from '../RichText'
|
||||||
import {Text} from '../Typography'
|
import {Text} from '../Typography'
|
||||||
import {MessageItemMetadata} from './MessageItem'
|
import {MessageItemMetadata} from './MessageItem'
|
||||||
|
|
||||||
type ReportDialogParams =
|
type ReportDialogParams = {
|
||||||
| {
|
|
||||||
type: 'convoAccount'
|
|
||||||
did: string
|
|
||||||
convoId: string
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
type: 'convoMessage'
|
type: 'convoMessage'
|
||||||
convoId: string
|
convoId: string
|
||||||
message: ChatBskyConvoDefs.MessageView
|
message: ChatBskyConvoDefs.MessageView
|
||||||
|
@ -76,7 +70,6 @@ function DialogInner({params}: {params: ReportDialogParams}) {
|
||||||
|
|
||||||
function ReasonStep({
|
function ReasonStep({
|
||||||
setReportOption,
|
setReportOption,
|
||||||
params,
|
|
||||||
}: {
|
}: {
|
||||||
setReportOption: (reportOption: ReportOption) => void
|
setReportOption: (reportOption: ReportOption) => void
|
||||||
params: ReportDialogParams
|
params: ReportDialogParams
|
||||||
|
@ -87,15 +80,9 @@ function ReasonStep({
|
||||||
<SelectReportOptionView
|
<SelectReportOptionView
|
||||||
labelers={[]}
|
labelers={[]}
|
||||||
goBack={control.close}
|
goBack={control.close}
|
||||||
params={
|
params={{
|
||||||
params.type === 'convoMessage'
|
|
||||||
? {
|
|
||||||
type: 'convoMessage',
|
type: 'convoMessage',
|
||||||
}
|
}}
|
||||||
: {
|
|
||||||
type: 'convoAccount',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onSelectReportOption={setReportOption}
|
onSelectReportOption={setReportOption}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
@ -138,17 +125,6 @@ function SubmitStep({
|
||||||
} satisfies ComAtprotoModerationCreateReport.InputSchema
|
} satisfies ComAtprotoModerationCreateReport.InputSchema
|
||||||
|
|
||||||
await getAgent().createModerationReport(report)
|
await getAgent().createModerationReport(report)
|
||||||
} else if (params.type === 'convoAccount') {
|
|
||||||
const {convoId, did} = params
|
|
||||||
|
|
||||||
await getAgent().createModerationReport({
|
|
||||||
reasonType: reportOption.reason,
|
|
||||||
subject: {
|
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
|
||||||
did,
|
|
||||||
},
|
|
||||||
reason: details + ` — from:dms:${convoId}`,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
|
@ -163,9 +139,6 @@ function SubmitStep({
|
||||||
convoMessage: {
|
convoMessage: {
|
||||||
title: _(msg`Report this message`),
|
title: _(msg`Report this message`),
|
||||||
},
|
},
|
||||||
convoAccount: {
|
|
||||||
title: _(msg`Report this account`),
|
|
||||||
},
|
|
||||||
}[params.type]
|
}[params.type]
|
||||||
}, [_, params])
|
}, [_, params])
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ interface ReportOptions {
|
||||||
feedgen: ReportOption[]
|
feedgen: ReportOption[]
|
||||||
other: ReportOption[]
|
other: ReportOption[]
|
||||||
convoMessage: ReportOption[]
|
convoMessage: ReportOption[]
|
||||||
convoAccount: ReportOption[]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useReportOptions(): ReportOptions {
|
export function useReportOptions(): ReportOptions {
|
||||||
|
@ -87,19 +86,6 @@ export function useReportOptions(): ReportOptions {
|
||||||
},
|
},
|
||||||
...common,
|
...common,
|
||||||
],
|
],
|
||||||
convoAccount: [
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONSPAM,
|
|
||||||
title: _(msg`Spam`),
|
|
||||||
description: _(msg`Excessive or unwanted messages`),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONSEXUAL,
|
|
||||||
title: _(msg`Unwanted Sexual Content`),
|
|
||||||
description: _(msg`Inappropriate messages or explicit links`),
|
|
||||||
},
|
|
||||||
...common,
|
|
||||||
],
|
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue