From d33e28791264a06a862def065565cb147d69e1d4 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 16 Jun 2020 17:29:22 -0700 Subject: [PATCH] fix: Spacing on tertiary links --- src/components/Sidebar.js | 12 ++++---- src/components/Sidebar.module.scss | 46 +++++++++++------------------- 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/src/components/Sidebar.js b/src/components/Sidebar.js index b579d66a3..45b89de78 100644 --- a/src/components/Sidebar.js +++ b/src/components/Sidebar.js @@ -13,7 +13,7 @@ import styles from './Sidebar.module.scss'; const renderNav = (pages, depthLevel = 0) => { return pages.map((page, index) => { const crumbs = useContext(BreadcrumbContext).flatMap((x) => x.displayName); - const [isDisplay, setIsDisplay] = useState( + const [isExpanded, setIsExpanded] = useState( crumbs.length === depthLevel || crumbs.includes(page.displayName) ); const isCurrentPage = crumbs[crumbs.length - 1] === page.displayName; @@ -39,8 +39,8 @@ const renderNav = (pages, depthLevel = 0) => {
setIsDisplay(!isDisplay)} - onKeyPress={() => setIsDisplay(!isDisplay)} + onClick={() => setIsExpanded((isExpanded) => !isExpanded)} + onKeyPress={() => setIsExpanded((isExpanded) => !isExpanded)} tabIndex={0} > {page.displayName} @@ -48,7 +48,9 @@ const renderNav = (pages, depthLevel = 0) => { )} {page.children && ( @@ -63,7 +65,7 @@ const Sidebar = ({ className, pages, isOpen }) => ( -