Add moderator-specific notice for disabled profiles and update translations

This commit is contained in:
MartinBraquet
2026-08-02 23:31:06 +02:00
parent b626de0144
commit 761455cb04
4 changed files with 17 additions and 2 deletions

View File

@@ -11,8 +11,8 @@ android {
applicationId "com.compassconnections.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 146
versionName "1.35.0"
versionCode 147
versionName "1.36.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

View File

@@ -973,6 +973,7 @@
"profile.has_kids_one": "Hat {count} Kind",
"profile.header.age": "{age}",
"profile.header.disabled_notice": "Sie haben Ihr Profil deaktiviert, niemand sonst kann darauf zugreifen.",
"profile.header.disabled_notice_mod": "{name} hat das Profil deaktiviert. Nur Moderatoren können diese Seite sehen.",
"profile.header.menu.disable_profile": "Profil deaktivieren",
"profile.header.menu.enable_profile": "Profil aktivieren",
"profile.header.menu.limit_members": "Nur auf Mitglieder beschränken",

View File

@@ -972,6 +972,7 @@
"profile.has_kids_one": "A {count} enfant",
"profile.header.age": "{age} ans",
"profile.header.disabled_notice": "Vous avez désactivé votre profil, personne d'autre ne peut y accéder.",
"profile.header.disabled_notice_mod": "{name} a désactivé son profil. Seuls les modérateurs peuvent voir cette page.",
"profile.header.menu.disable_profile": "Désactiver le profil",
"profile.header.menu.enable_profile": "Activer le profil",
"profile.header.menu.limit_members": "Limiter aux membres uniquement",

View File

@@ -10,6 +10,7 @@ import ProfileHeroPhoto from 'web/components/profile/profile-hero-photo'
import {useProfilePhotos} from 'web/components/profile/profile-photos'
import {ProfileConnectionGoals} from 'web/components/profile-about'
import {linkClass} from 'web/components/widgets/site-link'
import {useAdminOrMod} from 'web/hooks/use-admin'
import {useElementSize} from 'web/hooks/use-element-size'
import {useUser} from 'web/hooks/use-user'
import {useT} from 'web/lib/locale'
@@ -39,6 +40,7 @@ export default function ProfileHero(props: {
const {user, profile, isHiddenFromMe, simpleView} = props
const currentUser = useUser()
const isCurrentUser = currentUser?.id === user.id
const isMod = useAdminOrMod()
const t = useT()
const photos = useProfilePhotos(profile)
@@ -80,6 +82,17 @@ export default function ProfileHero(props: {
)}
</Notice>
)}
{/* Everyone else is turned away at the page level, so a mod reading this is the only visitor
there is — say so, or the page looks like an ordinary profile. */}
{!isCurrentUser && isMod && profile.disabled && (
<Notice icon={<LockClosedIcon className="h-4 w-4 flex-none" />} tone="danger">
{t(
'profile.header.disabled_notice_mod',
'{name} disabled their profile. Only moderators can see this page.',
{name: user.name},
)}
</Notice>
)}
{/* The text is capped rather than left to fill the row, and the photo follows it directly:
pinned to the far margin it read as a second column with a gutter of dead space between