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 profile = useProfileShadow(profileUnshadowed)
|
||||||
const rt = useMemo(() => {
|
const rt = useMemo(() => {
|
||||||
if (!('description' in profile)) return
|
if (!('description' in profile)) return
|
||||||
const rt = new RichTextApi({text: profile.description || ''})
|
const rt = new RichTextApi({text: (profile.description || '').trim()})
|
||||||
rt.detectFacetsWithoutResolution()
|
rt.detectFacetsWithoutResolution()
|
||||||
return rt
|
return rt
|
||||||
}, [profile])
|
}, [profile])
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ function ProfileScreenLoaded({
|
|||||||
|
|
||||||
useSetTitle(combinedDisplayName(profile))
|
useSetTitle(combinedDisplayName(profile))
|
||||||
|
|
||||||
const description = profile.description ?? ''
|
const description = (profile.description ?? '').trim()
|
||||||
const hasDescription = description !== ''
|
const hasDescription = description !== ''
|
||||||
const [descriptionRT, isResolvingDescriptionRT] = useRichText(description)
|
const [descriptionRT, isResolvingDescriptionRT] = useRichText(description)
|
||||||
const showPlaceholder = isPlaceholderProfile || isResolvingDescriptionRT
|
const showPlaceholder = isPlaceholderProfile || isResolvingDescriptionRT
|
||||||
|
|||||||
Reference in New Issue
Block a user