Skip to content

Commit e5f0c32

Browse files
authored
Kit/circular avatars (#927)
1 parent dbe973d commit e5f0c32

6 files changed

Lines changed: 18 additions & 11 deletions

File tree

‎desktop/src/features/channels/ui/ChannelScreenHeader.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function ChannelScreenHeader({
8585
activeChannel?.channelType === "dm" ? (
8686
<ProfileAvatar
8787
avatarUrl={activeDmAvatarUrl}
88-
className="h-6 w-6 rounded-md text-[10px]"
88+
className="h-6 w-6 rounded-full text-[10px]"
8989
iconClassName="h-3.5 w-3.5"
9090
label={activeChannelTitle}
9191
testId="chat-header-dm-avatar"

‎desktop/src/features/messages/ui/MessageRow.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export const MessageRow = React.memo(
205205
const isThreadReplyLayout = layoutVariant === "thread-reply";
206206
const guideBleedPx = isThreadReplyLayout ? 4 : 0;
207207
const avatarSizeClass = "!h-9 !w-9";
208-
const avatarButtonRadiusClass = "rounded-xl";
208+
const avatarButtonRadiusClass = "rounded-full";
209209

210210
const respondToDotColor =
211211
message.respondTo === "anyone"

‎desktop/src/features/messages/ui/MessageThreadSummaryRow.tsx‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ function ParticipantAvatar({
2121
<div
2222
className={index > 0 ? "-ml-2" : ""}
2323
data-testid="message-thread-summary-participant"
24-
style={{ zIndex: 10 - index }}
24+
style={{
25+
zIndex: 10 - index,
26+
...(index > 0 && {
27+
mask: "radial-gradient(circle 16px at -4px 50%, transparent 99%, #fff 100%)",
28+
WebkitMask:
29+
"radial-gradient(circle 16px at -4px 50%, transparent 99%, #fff 100%)",
30+
}),
31+
}}
2532
>
2633
<UserAvatar
2734
avatarUrl={participant.avatarUrl}
28-
className="h-7 w-7 text-[10px] ring-2 ring-background"
35+
className="h-7 w-7 text-[10px]"
2936
displayName={participant.author}
3037
size="sm"
3138
/>
@@ -88,14 +95,14 @@ export function MessageThreadSummaryRow({
8895

8996
<button
9097
aria-label={summaryAriaLabel}
91-
className="group relative isolate inline-flex h-8 w-fit max-w-full cursor-pointer items-center gap-1.5 rounded-[12px] text-left text-xs font-medium text-muted-foreground transition-[color,opacity] before:pointer-events-none before:absolute before:-bottom-0.5 before:-left-0.5 before:-right-2 before:-top-0.5 before:-z-10 before:rounded-[12px] before:content-[''] before:transition-[background-color,box-shadow] hover:text-foreground hover:opacity-90 hover:before:bg-background/95 hover:before:ring-1 hover:before:ring-border/70 focus-visible:outline-hidden focus-visible:before:bg-background/95 focus-visible:before:ring-1 focus-visible:before:ring-ring"
98+
className="group relative isolate inline-flex h-8 w-fit max-w-full cursor-pointer items-center gap-1.5 rounded-full text-left text-xs font-medium text-muted-foreground transition-[color,opacity] before:pointer-events-none before:absolute before:-bottom-0.5 before:-left-0.5 before:-right-2 before:-top-0.5 before:-z-10 before:rounded-full before:content-[''] before:transition-[background-color,box-shadow] hover:text-foreground hover:opacity-90 hover:before:bg-background/95 hover:before:ring-1 hover:before:ring-border/70 focus-visible:outline-hidden focus-visible:before:bg-background/95 focus-visible:before:ring-1 focus-visible:before:ring-ring"
9299
data-thread-head-id={message.id}
93100
data-testid="message-thread-summary"
94101
onClick={() => onOpenThread(message)}
95102
style={{ marginLeft: `${marginLeftPx}px` }}
96103
type="button"
97104
>
98-
<div className="flex shrink-0 items-center">
105+
<div className="ml-0.5 flex shrink-0 items-center">
99106
{summary.participants.map((participant, index) => (
100107
<ParticipantAvatar
101108
index={index}

‎desktop/src/features/sidebar/ui/SidebarSection.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function DmChannelIcon({
7070
<span className="relative flex h-5 w-5 shrink-0 items-center justify-center">
7171
<ProfileAvatar
7272
avatarUrl={primaryParticipant.avatarUrl}
73-
className="h-5 w-5 rounded-[6px] border border-sidebar-border/80 bg-sidebar-accent/80 text-[9px] text-sidebar-foreground shadow-none"
73+
className="h-5 w-5 rounded-full border border-sidebar-border/80 bg-sidebar-accent/80 text-[9px] text-sidebar-foreground shadow-none"
7474
iconClassName="h-3 w-3"
7575
label={primaryParticipant.label}
7676
/>
@@ -91,13 +91,13 @@ function DmChannelIcon({
9191
<span className="relative flex h-5 w-7 shrink-0 items-center">
9292
<ProfileAvatar
9393
avatarUrl={primaryParticipant.avatarUrl}
94-
className="absolute left-0 top-0 h-[18px] w-[18px] rounded-[6px] border-2 border-sidebar bg-sidebar-accent/80 text-[8px] text-sidebar-foreground shadow-none"
94+
className="absolute left-0 top-0 h-[18px] w-[18px] rounded-full border-2 border-sidebar bg-sidebar-accent/80 text-[8px] text-sidebar-foreground shadow-none"
9595
iconClassName="h-2.5 w-2.5"
9696
label={primaryParticipant.label}
9797
/>
9898
<ProfileAvatar
9999
avatarUrl={secondaryParticipant.avatarUrl}
100-
className="absolute bottom-0 right-0 h-[18px] w-[18px] rounded-[6px] border-2 border-sidebar bg-sidebar-accent/80 text-[8px] text-sidebar-foreground shadow-none"
100+
className="absolute bottom-0 right-0 h-[18px] w-[18px] rounded-full border-2 border-sidebar bg-sidebar-accent/80 text-[8px] text-sidebar-foreground shadow-none"
101101
iconClassName="h-2.5 w-2.5"
102102
label={secondaryParticipant.label}
103103
/>

‎desktop/src/shared/ui/ViewLoadingFallback.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function MessageRowsSkeleton() {
4747
<>
4848
{["first", "second", "third", "fourth", "fifth"].map((row, index) => (
4949
<div className="flex gap-3" key={row}>
50-
<Skeleton className="h-9 w-9 shrink-0 rounded-xl" />
50+
<Skeleton className="h-9 w-9 shrink-0 rounded-full" />
5151
<div className="min-w-0 flex-1 space-y-1 pt-0.5">
5252
<div className="flex items-baseline gap-2">
5353
<Skeleton className="h-3.5 w-28" />

‎desktop/src/shared/ui/avatar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Avatar = React.forwardRef<
1010
<AvatarPrimitive.Root
1111
ref={ref}
1212
className={cn(
13-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-lg",
13+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
1414
className,
1515
)}
1616
{...props}

0 commit comments

Comments
 (0)