ff5ad38253
* update eslint config with jsx runtime * leverage jsx transform to remove unnecessary react imports and update eslint config * run yarn lint --fix to remove eslint disables related to react/prop-types that is now disabled
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import {View} from 'react-native'
|
|
import {AppBskyActorDefs, ModerationDecision} from '@atproto/api'
|
|
|
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
|
import {Shadow} from '#/state/cache/types'
|
|
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
|
import {Text} from '#/components/Typography'
|
|
|
|
export function ProfileHeaderDisplayName({
|
|
profile,
|
|
moderation,
|
|
}: {
|
|
profile: Shadow<AppBskyActorDefs.ProfileViewDetailed>
|
|
moderation: ModerationDecision
|
|
}) {
|
|
const t = useTheme()
|
|
const {gtMobile} = useBreakpoints()
|
|
|
|
return (
|
|
<View pointerEvents="none">
|
|
<Text
|
|
emoji
|
|
testID="profileHeaderDisplayName"
|
|
style={[
|
|
t.atoms.text,
|
|
gtMobile ? a.text_4xl : a.text_3xl,
|
|
a.self_start,
|
|
a.font_heavy,
|
|
]}>
|
|
{sanitizeDisplayName(
|
|
profile.displayName || sanitizeHandle(profile.handle),
|
|
moderation.ui('displayName'),
|
|
)}
|
|
</Text>
|
|
</View>
|
|
)
|
|
}
|