Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat: reduce contact tap target to just author/contact name #4318

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 29 additions & 30 deletions packages/ui/src/components/AuthorRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,38 +134,37 @@ export function ChatAuthorRow({
const shouldTruncate = showEditedIndicator || firstRole || deliveryFailed;

return (
<Pressable onPress={deliveryFailed ? undefined : openProfile}>
<XStack gap="$l" alignItems="center" userSelect="none" {...props}>
<ContactAvatar size="$2xl" contactId={authorId} />
<XStack gap="$l" alignItems="flex-end">
<Text
size="$label/2xl"
numberOfLines={1}
maxWidth={shouldTruncate ? '55%' : '100%'}
>
<ContactName contactId={authorId} />
<XStack gap="$l" alignItems="center" userSelect="none" {...props}>
<ContactAvatar size="$2xl" contactId={authorId} />
<XStack gap="$l" alignItems="flex-end">
<Text
size="$label/2xl"
numberOfLines={1}
maxWidth={shouldTruncate ? '55%' : '100%'}
onPress={deliveryFailed ? undefined : openProfile}
>
<ContactName contactId={authorId} />
</Text>
{timeDisplay && (
<Text color="$secondaryText" size="$label/m">
{timeDisplay}
</Text>
)}
{showEditedIndicator && (
<Text size="$label/m" color="$secondaryText">
Edited
</Text>
)}
{firstRole && <RoleBadge role={firstRole} />}
{deliveryFailed ? (
<Text size="$label/m" color="$negativeActionText">
Tap to retry
</Text>
{timeDisplay && (
<Text color="$secondaryText" size="$label/m">
{timeDisplay}
</Text>
)}
{showEditedIndicator && (
<Text size="$label/m" color="$secondaryText">
Edited
</Text>
)}
{firstRole && <RoleBadge role={firstRole} />}
{deliveryFailed ? (
<Text size="$label/m" color="$negativeActionText">
Tap to retry
</Text>
) : null}
</XStack>
{!!deliveryStatus && deliveryStatus !== 'failed' ? (
<ChatMessageDeliveryStatus status={deliveryStatus} />
) : null}
</XStack>
</Pressable>
{!!deliveryStatus && deliveryStatus !== 'failed' ? (
<ChatMessageDeliveryStatus status={deliveryStatus} />
) : null}
</XStack>
);
}
Loading