From bc072570d27e1f397406daea355570f5aec95647 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 2 Jul 2025 00:36:04 +0300 Subject: Activity notification settings (#8485) Co-authored-by: Eric Bailey Co-authored-by: Samuel Newman Co-authored-by: hailey --- src/components/ProfileCard.tsx | 73 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 4 deletions(-) (limited to 'src/components/ProfileCard.tsx') diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index 30b26bead..4aec74880 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -11,6 +11,8 @@ import {useLingui} from '@lingui/react' import {useActorStatus} from '#/lib/actor-status' import {getModerationCauseKey} from '#/lib/moderation' import {type LogEvents} from '#/lib/statsig/statsig' +import {forceLTR} from '#/lib/strings/bidi' +import {NON_BREAKING_SPACE} from '#/lib/strings/constants' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' import {useProfileShadow} from '#/state/cache/profile-shadow' @@ -18,7 +20,7 @@ import {useProfileFollowMutationQueue} from '#/state/queries/profile' import {useSession} from '#/state/session' import * as Toast from '#/view/com/util/Toast' import {PreviewableUserAvatar, UserAvatar} from '#/view/com/util/UserAvatar' -import {atoms as a, useTheme} from '#/alf' +import {atoms as a, platform, useTheme} from '#/alf' import { Button, ButtonIcon, @@ -183,14 +185,77 @@ export function AvatarPlaceholder() { export function NameAndHandle({ profile, moderationOpts, + inline = false, }: { profile: bsky.profile.AnyProfileView moderationOpts: ModerationOpts + inline?: boolean }) { + if (inline) { + return ( + + ) + } else { + return ( + + + + + ) + } +} + +function InlineNameAndHandle({ + profile, + moderationOpts, +}: { + profile: bsky.profile.AnyProfileView + moderationOpts: ModerationOpts +}) { + const t = useTheme() + const verification = useSimpleVerificationState({profile}) + const moderation = moderateProfile(profile, moderationOpts) + const name = sanitizeDisplayName( + profile.displayName || sanitizeHandle(profile.handle), + moderation.ui('displayName'), + ) + const handle = sanitizeHandle(profile.handle, '@') return ( - - - + + + {forceLTR(name)} + + {verification.showBadge && ( + + + + )} + + {NON_BREAKING_SPACE + handle} + ) } -- cgit 1.4.1