From 3dc440632f94cef773dda34d830c0683d8114b54 Mon Sep 17 00:00:00 2001 From: marshennikovaolga Date: Mon, 9 Sep 2024 20:05:36 +0300 Subject: [PATCH] pages active sidebar background --- .../custom/sidebar/partial/page-section.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/web/components/custom/sidebar/partial/page-section.tsx b/web/components/custom/sidebar/partial/page-section.tsx index 8fe4e59c..94216769 100644 --- a/web/components/custom/sidebar/partial/page-section.tsx +++ b/web/components/custom/sidebar/partial/page-section.tsx @@ -57,7 +57,8 @@ export const PageSection: React.FC<{ pathname?: string }> = ({ pathname }) => { const [show, setShow] = useAtom(pageShowAtom) const pageCount = me?.root.personalPages?.length || 0 - const isActive = pathname ? pathname.startsWith("/pages") : false + // const isActive = pathname ? pathname.startsWith("/pages") : false + const isActive = pathname === "/pages" if (!me) return null @@ -74,21 +75,24 @@ interface PageSectionHeaderProps { isActive: boolean } -const PageSectionHeader: React.FC = ({ pageCount }) => ( +const PageSectionHeader: React.FC = ({ pageCount, isActive }) => (
-

+

Pages {pageCount > 0 && {pageCount}}

-
+