diff options
Diffstat (limited to 'src/components/ProfileCard.tsx')
-rw-r--r-- | src/components/ProfileCard.tsx | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index 394ff9946..1a64c51d5 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -166,29 +166,47 @@ export function NameAndHandle({ profile: bsky.profile.AnyProfileView moderationOpts: ModerationOpts }) { - const t = useTheme() + return ( + <View style={[a.flex_1]}> + <Name profile={profile} moderationOpts={moderationOpts} /> + <Handle profile={profile} /> + </View> + ) +} + +export function Name({ + profile, + moderationOpts, +}: { + profile: bsky.profile.AnyProfileView + moderationOpts: ModerationOpts +}) { const moderation = moderateProfile(profile, moderationOpts) const name = sanitizeDisplayName( profile.displayName || sanitizeHandle(profile.handle), moderation.ui('displayName'), ) + return ( + <Text + emoji + style={[a.text_md, a.font_bold, a.leading_snug, a.self_start]} + numberOfLines={1}> + {name} + </Text> + ) +} + +export function Handle({profile}: {profile: bsky.profile.AnyProfileView}) { + const t = useTheme() const handle = sanitizeHandle(profile.handle, '@') return ( - <View style={[a.flex_1]}> - <Text - emoji - style={[a.text_md, a.font_bold, a.leading_snug, a.self_start]} - numberOfLines={1}> - {name} - </Text> - <Text - emoji - style={[a.leading_snug, t.atoms.text_contrast_medium]} - numberOfLines={1}> - {handle} - </Text> - </View> + <Text + emoji + style={[a.leading_snug, t.atoms.text_contrast_medium]} + numberOfLines={1}> + {handle} + </Text> ) } |