From 9c05eb8ccbc3598c4f4e0e77d547a83a0494e29a Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 24 Feb 2025 10:02:52 -0600 Subject: [PATCH] Add copyright link --- .../moderation/ReportDialog/const.ts | 99 +------------------ .../moderation/ReportDialog/index.tsx | 37 ++++++- 2 files changed, 37 insertions(+), 99 deletions(-) diff --git a/src/components/moderation/ReportDialog/const.ts b/src/components/moderation/ReportDialog/const.ts index 2b34633606..30c9aff88d 100644 --- a/src/components/moderation/ReportDialog/const.ts +++ b/src/components/moderation/ReportDialog/const.ts @@ -1,98 +1 @@ -import {ComAtprotoModerationDefs} from '@atproto/api' - -import {ParsedReportSubject} from './types' - -export const ALL_REPORT_REASON_TYPES = [ - 'com.atproto.moderation.defs#reasonSpam', - 'com.atproto.moderation.defs#reasonViolation', - 'com.atproto.moderation.defs#reasonMisleading', - 'com.atproto.moderation.defs#reasonSexual', - 'com.atproto.moderation.defs#reasonRude', - 'com.atproto.moderation.defs#reasonHarassment', - 'com.atproto.moderation.defs#reasonAnimalAbuse', - 'com.atproto.moderation.defs#reasonGraphic', - 'com.atproto.moderation.defs#reasonScam', - 'com.atproto.moderation.defs#reasonProhibitedCommerce', - 'com.atproto.moderation.defs#reasonInauthentic', - 'com.atproto.moderation.defs#reasonImpersonation', - 'com.atproto.moderation.defs#reasonBanEvasion', - 'com.atproto.moderation.defs#reasonChildSafety', - 'com.atproto.moderation.defs#reasonSelfHarm', - 'com.atproto.moderation.defs#reasonThreat', - 'com.atproto.moderation.defs#reasonIntolerance', - 'com.atproto.moderation.defs#reasonPrivateInfo', - 'com.atproto.moderation.defs#reasonSexualAbuse', - 'com.atproto.moderation.defs#reasonSiteSecurity', - 'com.atproto.moderation.defs#reasonTerrorViolentExtremist', - 'com.atproto.moderation.defs#reasonSpoiler', - 'com.atproto.moderation.defs#reasonGrowthHack', - 'com.atproto.moderation.defs#reasonOther', -] - -const REASONHARRASSMENT = 'com.atproto.moderation.defs#reasonHarassment' -const REASONINAUTHENTIC = 'com.atproto.moderation.defs#reasonInauthentic' -const REASONIMPERSONATION = 'com.atproto.moderation.defs#reasonImpersonation' -const REASONBANEVASION = 'com.atproto.moderation.defs#reasonBanEvasion' -const REASONTERRORVIOLENTEXTREMIST = - 'com.atproto.moderation.defs#reasonTerrorViolentExtremist' -const REASONANIMALABUSE = 'com.atproto.moderation.defs#reasonAnimalAbuse' -const REASONGRAPHIC = 'com.atproto.moderation.defs#reasonGraphic' -const REASONSCAM = 'com.atproto.moderation.defs#reasonScam' -const REASONPROHIBITEDCOMMERCE = - 'com.atproto.moderation.defs#reasonProhibitedCommerce' -const REASONCHILDSAFETY = 'com.atproto.moderation.defs#reasonChildSafety' -const REASONSELFHARM = 'com.atproto.moderation.defs#reasonSelfHarm' -const REASONTHREAT = 'com.atproto.moderation.defs#reasonThreat' -const REASONINTOLERANCE = 'com.atproto.moderation.defs#reasonIntolerance' -const REASONPRIVATEINFO = 'com.atproto.moderation.defs#reasonPrivateInfo' -const REASONSEXUALABUSE = 'com.atproto.moderation.defs#reasonSexualAbuse' -const REASONSITESECURITY = 'com.atproto.moderation.defs#reasonSiteSecurity' - -const RECORD_REPORT_OPTIONS = [ - ComAtprotoModerationDefs.REASONSPAM, - REASONHARRASSMENT, - ComAtprotoModerationDefs.REASONMISLEADING, - ComAtprotoModerationDefs.REASONSEXUAL, - REASONANIMALABUSE, - REASONGRAPHIC, - REASONSCAM, - REASONPROHIBITEDCOMMERCE, - REASONCHILDSAFETY, - REASONSELFHARM, - REASONTHREAT, - REASONINTOLERANCE, - REASONPRIVATEINFO, - REASONSEXUALABUSE, - REASONSITESECURITY, - REASONTERRORVIOLENTEXTREMIST, - - ComAtprotoModerationDefs.REASONOTHER, -] - -export const REPORT_OPTIONS: Record = { - account: [ - REASONHARRASSMENT, - REASONINAUTHENTIC, - REASONIMPERSONATION, - REASONBANEVASION, - REASONTERRORVIOLENTEXTREMIST, - ComAtprotoModerationDefs.REASONSPAM, - ComAtprotoModerationDefs.REASONMISLEADING, - ComAtprotoModerationDefs.REASONOTHER, - ], - post: RECORD_REPORT_OPTIONS, - list: RECORD_REPORT_OPTIONS, - feed: RECORD_REPORT_OPTIONS, - starterPack: RECORD_REPORT_OPTIONS, - chatMessage: [ - ComAtprotoModerationDefs.REASONSPAM, - REASONHARRASSMENT, - ComAtprotoModerationDefs.REASONSEXUAL, - REASONSCAM, - REASONCHILDSAFETY, - REASONSELFHARM, - REASONTHREAT, - REASONPRIVATEINFO, - ComAtprotoModerationDefs.REASONOTHER, - ], -} +export const DMCA_LINK = 'https://bsky.social/about/support/copyright' diff --git a/src/components/moderation/ReportDialog/index.tsx b/src/components/moderation/ReportDialog/index.tsx index edbc01d0c8..5fbbd724e0 100644 --- a/src/components/moderation/ReportDialog/index.tsx +++ b/src/components/moderation/ReportDialog/index.tsx @@ -23,11 +23,13 @@ import { CheckThick_Stroke2_Corner0_Rounded as Check, } from '#/components/icons/Check' import {PaperPlane_Stroke2_Corner0_Rounded as PaperPlane} from '#/components/icons/PaperPlane' +import {SquareArrowTopRight_Stroke2_Corner0_Rounded as SquareArrowTopRight} from '#/components/icons/SquareArrowTopRight' import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times' -import {createStaticClick, InlineLinkText} from '#/components/Link' +import {createStaticClick, InlineLinkText, Link} from '#/components/Link' import {Loader} from '#/components/Loader' import {Text} from '#/components/Typography' import {useSubmitReportMutation} from './action' +import {DMCA_LINK} from './const' import {useCopyForSubject} from './copy' import {initialState, reducer} from './state' import {ReportDialogProps, ReportSubject} from './types' @@ -76,6 +78,7 @@ function Invalid() { } function Inner(props: ReportDialogProps) { + const t = useTheme() const {_} = useLingui() const ref = React.useRef(null) const { @@ -217,6 +220,38 @@ function Inner(props: ReportDialogProps) { }} /> ))} + + {['post', 'account'].includes(props.subject.type) && ( + + {({hovered, pressed}) => ( + + + Need to report a copyright violation? + + + + )} + + )} )}