Starter Packs (#4332)
Co-authored-by: Dan Abramov <dan.abramov@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
parent
35f64535cb
commit
f089f45781
115 changed files with 6336 additions and 237 deletions
21
src/lib/moderation/create-sanitized-display-name.ts
Normal file
21
src/lib/moderation/create-sanitized-display-name.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import {AppBskyActorDefs} from '@atproto/api'
|
||||
|
||||
import {sanitizeDisplayName} from 'lib/strings/display-names'
|
||||
import {sanitizeHandle} from 'lib/strings/handles'
|
||||
|
||||
export function createSanitizedDisplayName(
|
||||
profile:
|
||||
| AppBskyActorDefs.ProfileViewBasic
|
||||
| AppBskyActorDefs.ProfileViewDetailed,
|
||||
noAt = false,
|
||||
) {
|
||||
if (profile.displayName != null && profile.displayName !== '') {
|
||||
return sanitizeDisplayName(profile.displayName)
|
||||
} else {
|
||||
let sanitizedHandle = sanitizeHandle(profile.handle)
|
||||
if (!noAt) {
|
||||
sanitizedHandle = `@${sanitizedHandle}`
|
||||
}
|
||||
return sanitizedHandle
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ interface ReportOptions {
|
|||
account: ReportOption[]
|
||||
post: ReportOption[]
|
||||
list: ReportOption[]
|
||||
starterpack: ReportOption[]
|
||||
feedgen: ReportOption[]
|
||||
other: ReportOption[]
|
||||
convoMessage: ReportOption[]
|
||||
|
@ -94,6 +95,14 @@ export function useReportOptions(): ReportOptions {
|
|||
},
|
||||
...common,
|
||||
],
|
||||
starterpack: [
|
||||
{
|
||||
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
||||
title: _(msg`Name or Description Violates Community Standards`),
|
||||
description: _(msg`Terms used violate community standards`),
|
||||
},
|
||||
...common,
|
||||
],
|
||||
feedgen: [
|
||||
{
|
||||
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue