Skip to content

Commit

Permalink
Merge pull request #4318 from tloncorp/po/tlon-3324-reduce-contact-ta…
Browse files Browse the repository at this point in the history
…p-target

chat: reduce contact tap target to just author/contact name
  • Loading branch information
patosullivan authored Jan 8, 2025
2 parents f31353f + 3044fc1 commit d8b5485
Showing 1 changed file with 29 additions and 30 deletions.
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>
);
}

0 comments on commit d8b5485

Please sign in to comment.