Skip to content

Commit e366372

Browse files
tlongwell-blockEvaTyler Longwell
authored
fix(desktop): DM close button replaces unread badge on hover (#1280)
Signed-off-by: Tyler Longwell <[email protected]> Co-authored-by: Eva <[email protected]> Co-authored-by: Tyler Longwell <[email protected]>
1 parent 5fef9b7 commit e366372

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const SECTION_LABEL_CHEVRON_ICON_CLASS =
4040
"absolute left-1/2 top-1/2 size-2.5 -translate-x-1/2 -translate-y-1/2";
4141
const SIDEBAR_ROW_ACTION_VISIBILITY_CLASS =
4242
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 md:opacity-0";
43+
const SIDEBAR_ROW_ACTION_REPLACED_BADGE_CLASS =
44+
"max-md:opacity-0 md:group-focus-within/menu-item:opacity-0 md:group-hover/menu-item:opacity-0";
4345
const SIDEBAR_ROW_ICON_ACTION_CLASS =
4446
"flex size-6 items-center justify-center p-1 text-sidebar-foreground/45 transition-colors hover:text-sidebar-foreground focus-visible:text-sidebar-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring peer-data-[active=true]/menu-button:text-sidebar-active-foreground/75 peer-data-[active=true]/menu-button:hover:text-sidebar-active-foreground [&>svg]:size-4 [&>svg]:shrink-0";
4547

@@ -376,7 +378,10 @@ export function SidebarSection({
376378
!(isActiveChannel && selectedChannelId === channel.id) ? (
377379
<UnreadCountBadge
378380
channelName={channel.name}
379-
className="absolute right-1 top-1/2 -translate-y-1/2"
381+
className={cn(
382+
"pointer-events-none absolute right-1 top-1/2 -translate-y-1/2 transition-opacity",
383+
onHideDm && SIDEBAR_ROW_ACTION_REPLACED_BADGE_CLASS,
384+
)}
380385
count={Math.max(
381386
unreadChannelCounts.get(channel.id) ?? 0,
382387
1,

0 commit comments

Comments
 (0)