More useful block-state information in embeds (#1150)

* More useful block-state information in embeds

* Tune copy
zio/stable
Paul Frazee 2023-08-10 16:25:11 -07:00 committed by GitHub
parent ac6f6eef66
commit e5b7a894a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 10 deletions

View File

@ -24,7 +24,7 @@
"e2e:run": "detox test --configuration ios.sim.debug --take-screenshots all"
},
"dependencies": {
"@atproto/api": "^0.6.1",
"@atproto/api": "^0.6.3",
"@bam.tech/react-native-image-resizer": "^3.0.4",
"@braintree/sanitize-url": "^6.0.2",
"@expo/html-elements": "^0.4.2",

View File

@ -18,16 +18,23 @@ export function describeModerationCause(
}
if (cause.type === 'blocking') {
return {
name: 'Blocked User',
name: 'User Blocked',
description: 'You have blocked this user. You cannot view their content.',
}
}
if (cause.type === 'blocked-by') {
return {
name: 'Blocking You',
name: 'User Blocking You',
description: 'This user has blocked you. You cannot view their content.',
}
}
if (cause.type === 'block-other') {
return {
name: 'Content Not Available',
description:
'This content is not available because one of the users involved has blocked the other.',
}
}
if (cause.type === 'muted') {
if (cause.source.type === 'list') {
return {

View File

@ -29,11 +29,15 @@ export function Component({
description =
'Moderator has chosen to set a general warning on the content.'
} else if (moderation.cause.type === 'blocking') {
name = 'Account Blocked'
name = 'User Blocked'
description = 'You have blocked this user. You cannot view their content.'
} else if (moderation.cause.type === 'blocked-by') {
name = 'Account Blocks You'
name = 'User Blocks You'
description = 'This user has blocked you. You cannot view their content.'
} else if (moderation.cause.type === 'block-other') {
name = 'Content Not Available'
description =
'This content is not available because one of the users involved has blocked the other.'
} else if (moderation.cause.type === 'muted') {
if (moderation.cause.source.type === 'list') {
const list = moderation.cause.source.list

View File

@ -41,12 +41,23 @@ export function ContentHider({
onPress={() => {
if (!moderation.noOverride) {
setOverride(v => !v)
} else {
store.shell.openModal({
name: 'moderation-details',
context: 'content',
moderation,
})
}
}}
accessibilityRole="button"
accessibilityHint={override ? 'Hide the content' : 'Show the content'}
accessibilityLabel=""
style={[styles.cover, pal.viewLight]}>
style={[
styles.cover,
moderation.noOverride
? {borderWidth: 1, borderColor: pal.colors.borderDark}
: pal.viewLight,
]}>
<Pressable
onPress={() => {
store.shell.openModal({

View File

@ -40,10 +40,10 @@
tlds "^1.234.0"
typed-emitter "^2.1.0"
"@atproto/api@^0.6.1":
version "0.6.1"
resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.6.1.tgz#1a4794c4e379f3790dbc1c2cc69e0700c711f634"
integrity sha512-Fwp3GxSxy04XCScLNb7gdYuITt3beUPM2gOmAaJJ/c0muvj3BS/lGeeEqHToSMlxyirfPQYiTHDGcDZgo6EpMQ==
"@atproto/api@^0.6.3":
version "0.6.3"
resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.6.3.tgz#2d604897df9098d84f3dfb3bffe1d4859513b1ba"
integrity sha512-vgwJn6M4wEyMm/oQKSATO3C0iRUZ/u5LTTl3E/MqV1mrWzvWLVhOqlATw7CDhEdzwJciO83ei72re6skhSp+Zg==
dependencies:
"@atproto/common-web" "*"
"@atproto/uri" "*"