Skip to content

Commit 51babe0

Browse files
Fix anchor text overflow in threads v2 (#8530)
1 parent 04a2a22 commit 51babe0

File tree

3 files changed

+49
-55
lines changed

3 files changed

+49
-55
lines changed

src/components/ProfileHoverCard/index.web.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function ProfileHoverCard(props: ProfileHoverCardProps) {
7474
return props.children
7575
} else {
7676
return (
77-
<View onPointerMove={onPointerMove} style={[a.flex_shrink]}>
77+
<View onPointerMove={onPointerMove} style={[a.flex_shrink, props.style]}>
7878
<ProfileHoverCardInner {...props} />
7979
</View>
8080
)
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type React from 'react'
22

3-
export type ProfileHoverCardProps = {
4-
children: React.ReactElement
3+
import {type ViewStyleProp} from '#/alf'
4+
5+
export type ProfileHoverCardProps = ViewStyleProp & {
6+
children: React.ReactNode
57
did: string
68
disable?: boolean
79
}

src/screens/PostThread/components/ThreadItemAnchor.tsx

Lines changed: 44 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -311,69 +311,61 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({
311311
isRoot && [a.pt_lg],
312312
]}>
313313
<View style={[a.flex_row, a.gap_md, a.pb_md]}>
314-
<PreviewableUserAvatar
315-
size={42}
316-
profile={post.author}
317-
moderation={moderation.ui('avatar')}
318-
type={post.author.associated?.labeler ? 'labeler' : 'user'}
319-
live={live}
320-
onBeforePress={onOpenAuthor}
321-
/>
322-
<View style={[a.flex_1, a.align_start]}>
323-
<ProfileHoverCard did={post.author.did}>
324-
<View style={[a.flex_1]}>
314+
<View collapsable={false}>
315+
<PreviewableUserAvatar
316+
size={42}
317+
profile={post.author}
318+
moderation={moderation.ui('avatar')}
319+
type={post.author.associated?.labeler ? 'labeler' : 'user'}
320+
live={live}
321+
onBeforePress={onOpenAuthor}
322+
/>
323+
</View>
324+
<Link
325+
to={authorHref}
326+
style={[a.flex_1]}
327+
label={sanitizeDisplayName(
328+
post.author.displayName || sanitizeHandle(post.author.handle),
329+
moderation.ui('displayName'),
330+
)}
331+
onPress={onOpenAuthor}>
332+
<View style={[a.flex_1, a.align_start]}>
333+
<ProfileHoverCard did={post.author.did} style={[a.w_full]}>
325334
<View style={[a.flex_row, a.align_center]}>
326-
<Link
327-
to={authorHref}
328-
style={[a.flex_shrink]}
329-
label={sanitizeDisplayName(
335+
<Text
336+
emoji
337+
style={[
338+
a.flex_shrink,
339+
a.text_lg,
340+
a.font_bold,
341+
a.leading_snug,
342+
]}
343+
numberOfLines={1}>
344+
{sanitizeDisplayName(
330345
post.author.displayName ||
331346
sanitizeHandle(post.author.handle),
332347
moderation.ui('displayName'),
333348
)}
334-
onPress={onOpenAuthor}>
335-
<Text
336-
emoji
337-
style={[
338-
a.text_lg,
339-
a.font_bold,
340-
a.leading_snug,
341-
a.self_start,
342-
]}
343-
numberOfLines={1}>
344-
{sanitizeDisplayName(
345-
post.author.displayName ||
346-
sanitizeHandle(post.author.handle),
347-
moderation.ui('displayName'),
348-
)}
349-
</Text>
350-
</Link>
349+
</Text>
351350

352351
<View style={[{paddingLeft: 3, top: -1}]}>
353352
<VerificationCheckButton profile={authorShadow} size="md" />
354353
</View>
355354
</View>
356-
<View style={[a.align_start]}>
357-
<Link
358-
style={[a.flex_shrink]}
359-
to={authorHref}
360-
label={sanitizeHandle(post.author.handle, '@')}>
361-
<Text
362-
style={[
363-
a.text_md,
364-
a.leading_snug,
365-
t.atoms.text_contrast_medium,
366-
]}
367-
numberOfLines={1}>
368-
{sanitizeHandle(post.author.handle, '@')}
369-
</Text>
370-
</Link>
371-
</View>
372-
</View>
373-
</ProfileHoverCard>
374-
</View>
355+
<Text
356+
style={[
357+
a.text_md,
358+
a.leading_snug,
359+
t.atoms.text_contrast_medium,
360+
]}
361+
numberOfLines={1}>
362+
{sanitizeHandle(post.author.handle, '@')}
363+
</Text>
364+
</ProfileHoverCard>
365+
</View>
366+
</Link>
375367
{showFollowButton && (
376-
<View>
368+
<View collapsable={false}>
377369
<PostThreadFollowBtn did={post.author.did} />
378370
</View>
379371
)}

0 commit comments

Comments
 (0)