Trim profile descriptions in profile screen and ProfileCard
Adds .trim() to profile descriptions to remove leading/trailing whitespace that can cause layout issues in the UI.
This commit is contained in:
@@ -409,7 +409,7 @@ export function Description({
|
||||
const profile = useProfileShadow(profileUnshadowed)
|
||||
const rt = useMemo(() => {
|
||||
if (!('description' in profile)) return
|
||||
const rt = new RichTextApi({text: profile.description || ''})
|
||||
const rt = new RichTextApi({text: (profile.description || '').trim()})
|
||||
rt.detectFacetsWithoutResolution()
|
||||
return rt
|
||||
}, [profile])
|
||||
|
||||
@@ -203,7 +203,7 @@ function ProfileScreenLoaded({
|
||||
|
||||
useSetTitle(combinedDisplayName(profile))
|
||||
|
||||
const description = profile.description ?? ''
|
||||
const description = (profile.description ?? '').trim()
|
||||
const hasDescription = description !== ''
|
||||
const [descriptionRT, isResolvingDescriptionRT] = useRichText(description)
|
||||
const showPlaceholder = isPlaceholderProfile || isResolvingDescriptionRT
|
||||
|
||||
Reference in New Issue
Block a user