From 42550a003a57e39607c7b5ed189e044fac97f466 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 14 May 2025 00:23:55 -0400 Subject: [PATCH] fix: Icon on collection home does not match sidebar when private (#9209) --- app/components/IconPicker/index.tsx | 6 +++++- app/scenes/Collection/index.tsx | 14 ++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/components/IconPicker/index.tsx b/app/components/IconPicker/index.tsx index b094c40188..eb72cb5bb3 100644 --- a/app/components/IconPicker/index.tsx +++ b/app/components/IconPicker/index.tsx @@ -45,6 +45,7 @@ type Props = { onChange: (icon: string | null, color: string | null) => void; onOpen?: () => void; onClose?: () => void; + children?: React.ReactNode; }; const IconPicker = ({ @@ -59,6 +60,7 @@ const IconPicker = ({ onOpen, onClose, borderOnHover, + children, }: Props) => { const { t } = useTranslation(); @@ -174,7 +176,9 @@ const IconPicker = ({ onClick={handlePopoverButtonClick} $borderOnHover={borderOnHover} > - {iconType && icon ? ( + {children ? ( + children + ) : iconType && icon ? ( ) : ( diff --git a/app/scenes/Collection/index.tsx b/app/scenes/Collection/index.tsx index 8ee317bd2a..c119eacc28 100644 --- a/app/scenes/Collection/index.tsx +++ b/app/scenes/Collection/index.tsx @@ -12,7 +12,7 @@ import { } from "react-router-dom"; import styled from "styled-components"; import breakpoint from "styled-components-breakpoint"; -import Icon, { IconTitleWrapper } from "@shared/components/Icon"; +import { IconTitleWrapper } from "@shared/components/Icon"; import { s } from "@shared/styles"; import { StatusFilter } from "@shared/types"; import { colorPalette } from "@shared/utils/collections"; @@ -139,11 +139,7 @@ const CollectionScene = observer(function _CollectionScene() { const hasOverview = can.update || collection?.hasDescription; const fallbackIcon = collection ? ( - + ) : null; const tabProps = (path: CollectionPath) => ({ @@ -162,7 +158,7 @@ const CollectionScene = observer(function _CollectionScene() { left={ collection.isArchived ? ( - ) : collection.isEmpty ? undefined : ( + ) : ( + > + {fallbackIcon} + ) : ( fallbackIcon