mirror of
https://github.com/block/buzz.git
synced 2026-11-12 12:22:06 +00:00
Kit/circular avatars (#927)
This commit is contained in:
@@ -85,7 +85,7 @@ export function ChannelScreenHeader({
|
|||||||
activeChannel?.channelType === "dm" ? (
|
activeChannel?.channelType === "dm" ? (
|
||||||
<ProfileAvatar
|
<ProfileAvatar
|
||||||
avatarUrl={activeDmAvatarUrl}
|
avatarUrl={activeDmAvatarUrl}
|
||||||
className="h-6 w-6 rounded-md text-[10px]"
|
className="h-6 w-6 rounded-full text-[10px]"
|
||||||
iconClassName="h-3.5 w-3.5"
|
iconClassName="h-3.5 w-3.5"
|
||||||
label={activeChannelTitle}
|
label={activeChannelTitle}
|
||||||
testId="chat-header-dm-avatar"
|
testId="chat-header-dm-avatar"
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ export const MessageRow = React.memo(
|
|||||||
const isThreadReplyLayout = layoutVariant === "thread-reply";
|
const isThreadReplyLayout = layoutVariant === "thread-reply";
|
||||||
const guideBleedPx = isThreadReplyLayout ? 4 : 0;
|
const guideBleedPx = isThreadReplyLayout ? 4 : 0;
|
||||||
const avatarSizeClass = "!h-9 !w-9";
|
const avatarSizeClass = "!h-9 !w-9";
|
||||||
const avatarButtonRadiusClass = "rounded-xl";
|
const avatarButtonRadiusClass = "rounded-full";
|
||||||
|
|
||||||
const respondToDotColor =
|
const respondToDotColor =
|
||||||
message.respondTo === "anyone"
|
message.respondTo === "anyone"
|
||||||
|
|||||||
@@ -21,11 +21,18 @@ function ParticipantAvatar({
|
|||||||
<div
|
<div
|
||||||
className={index > 0 ? "-ml-2" : ""}
|
className={index > 0 ? "-ml-2" : ""}
|
||||||
data-testid="message-thread-summary-participant"
|
data-testid="message-thread-summary-participant"
|
||||||
style={{ zIndex: 10 - index }}
|
style={{
|
||||||
|
zIndex: 10 - index,
|
||||||
|
...(index > 0 && {
|
||||||
|
mask: "radial-gradient(circle 16px at -4px 50%, transparent 99%, #fff 100%)",
|
||||||
|
WebkitMask:
|
||||||
|
"radial-gradient(circle 16px at -4px 50%, transparent 99%, #fff 100%)",
|
||||||
|
}),
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<UserAvatar
|
<UserAvatar
|
||||||
avatarUrl={participant.avatarUrl}
|
avatarUrl={participant.avatarUrl}
|
||||||
className="h-7 w-7 text-[10px] ring-2 ring-background"
|
className="h-7 w-7 text-[10px]"
|
||||||
displayName={participant.author}
|
displayName={participant.author}
|
||||||
size="sm"
|
size="sm"
|
||||||
/>
|
/>
|
||||||
@@ -88,14 +95,14 @@ export function MessageThreadSummaryRow({
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
aria-label={summaryAriaLabel}
|
aria-label={summaryAriaLabel}
|
||||||
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"
|
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"
|
||||||
data-thread-head-id={message.id}
|
data-thread-head-id={message.id}
|
||||||
data-testid="message-thread-summary"
|
data-testid="message-thread-summary"
|
||||||
onClick={() => onOpenThread(message)}
|
onClick={() => onOpenThread(message)}
|
||||||
style={{ marginLeft: `${marginLeftPx}px` }}
|
style={{ marginLeft: `${marginLeftPx}px` }}
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<div className="flex shrink-0 items-center">
|
<div className="ml-0.5 flex shrink-0 items-center">
|
||||||
{summary.participants.map((participant, index) => (
|
{summary.participants.map((participant, index) => (
|
||||||
<ParticipantAvatar
|
<ParticipantAvatar
|
||||||
index={index}
|
index={index}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ function DmChannelIcon({
|
|||||||
<span className="relative flex h-5 w-5 shrink-0 items-center justify-center">
|
<span className="relative flex h-5 w-5 shrink-0 items-center justify-center">
|
||||||
<ProfileAvatar
|
<ProfileAvatar
|
||||||
avatarUrl={primaryParticipant.avatarUrl}
|
avatarUrl={primaryParticipant.avatarUrl}
|
||||||
className="h-5 w-5 rounded-[6px] border border-sidebar-border/80 bg-sidebar-accent/80 text-[9px] text-sidebar-foreground shadow-none"
|
className="h-5 w-5 rounded-full border border-sidebar-border/80 bg-sidebar-accent/80 text-[9px] text-sidebar-foreground shadow-none"
|
||||||
iconClassName="h-3 w-3"
|
iconClassName="h-3 w-3"
|
||||||
label={primaryParticipant.label}
|
label={primaryParticipant.label}
|
||||||
/>
|
/>
|
||||||
@@ -91,13 +91,13 @@ function DmChannelIcon({
|
|||||||
<span className="relative flex h-5 w-7 shrink-0 items-center">
|
<span className="relative flex h-5 w-7 shrink-0 items-center">
|
||||||
<ProfileAvatar
|
<ProfileAvatar
|
||||||
avatarUrl={primaryParticipant.avatarUrl}
|
avatarUrl={primaryParticipant.avatarUrl}
|
||||||
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"
|
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"
|
||||||
iconClassName="h-2.5 w-2.5"
|
iconClassName="h-2.5 w-2.5"
|
||||||
label={primaryParticipant.label}
|
label={primaryParticipant.label}
|
||||||
/>
|
/>
|
||||||
<ProfileAvatar
|
<ProfileAvatar
|
||||||
avatarUrl={secondaryParticipant.avatarUrl}
|
avatarUrl={secondaryParticipant.avatarUrl}
|
||||||
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"
|
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"
|
||||||
iconClassName="h-2.5 w-2.5"
|
iconClassName="h-2.5 w-2.5"
|
||||||
label={secondaryParticipant.label}
|
label={secondaryParticipant.label}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ function MessageRowsSkeleton() {
|
|||||||
<>
|
<>
|
||||||
{["first", "second", "third", "fourth", "fifth"].map((row, index) => (
|
{["first", "second", "third", "fourth", "fifth"].map((row, index) => (
|
||||||
<div className="flex gap-3" key={row}>
|
<div className="flex gap-3" key={row}>
|
||||||
<Skeleton className="h-9 w-9 shrink-0 rounded-xl" />
|
<Skeleton className="h-9 w-9 shrink-0 rounded-full" />
|
||||||
<div className="min-w-0 flex-1 space-y-1 pt-0.5">
|
<div className="min-w-0 flex-1 space-y-1 pt-0.5">
|
||||||
<div className="flex items-baseline gap-2">
|
<div className="flex items-baseline gap-2">
|
||||||
<Skeleton className="h-3.5 w-28" />
|
<Skeleton className="h-3.5 w-28" />
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const Avatar = React.forwardRef<
|
|||||||
<AvatarPrimitive.Root
|
<AvatarPrimitive.Root
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-lg",
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Reference in New Issue
Block a user