Stripe checkmark emojis from display names (close #396) (#419)

This commit is contained in:
Paul Frazee 2023-04-07 11:09:25 -05:00 committed by GitHub
parent 4b98992257
commit ab11f206d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 58 additions and 23 deletions

View file

@ -9,6 +9,7 @@ import {UserAvatar} from './UserAvatar'
import {observer} from 'mobx-react-lite'
import {FollowButton} from '../profile/FollowButton'
import {FollowState} from 'state/models/cache/my-follows'
import {sanitizeDisplayName} from 'lib/strings/display-names'
interface PostMetaOpts {
authorAvatar?: string
@ -52,7 +53,7 @@ export const PostMeta = observer(function (opts: PostMetaOpts) {
style={pal.text}
numberOfLines={1}
lineHeight={1.2}
text={displayName}
text={sanitizeDisplayName(displayName)}
href={`/profile/${opts.authorHandle}`}
/>
<Text type="md" style={pal.textLight} lineHeight={1.2}>
@ -103,7 +104,7 @@ export const PostMeta = observer(function (opts: PostMetaOpts) {
lineHeight={1.2}
text={
<>
{displayName}
{sanitizeDisplayName(displayName)}
<Text type="md" style={[pal.textLight]}>
&nbsp;{handle}
</Text>

View file

@ -6,6 +6,7 @@ import {Text} from './text/Text'
import {LoadingPlaceholder} from './LoadingPlaceholder'
import {useStores} from 'state/index'
import {TypographyVariant} from 'lib/ThemeContext'
import {sanitizeDisplayName} from 'lib/strings/display-names'
export function UserInfoText({
type = 'md',
@ -68,7 +69,9 @@ export function UserInfoText({
lineHeight={1.2}
numberOfLines={1}
href={`/profile/${profile.handle}`}
text={`${prefix || ''}${profile[attr] || profile.handle}`}
text={`${prefix || ''}${sanitizeDisplayName(
profile[attr] || profile.handle,
)}`}
/>
)
} else {