Skip to content

Commit

Permalink
no sidebar on mobile landing
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Feb 10, 2024
1 parent 0b98b52 commit 1de3c86
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
5 changes: 4 additions & 1 deletion client/src/curriculum/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export function CurriculumLayout({
<>
<div className="sticky-header-container">
<TopNavigation />
<ArticleActionsContainer doc={doc} />
<ArticleActionsContainer
doc={doc}
withSidebar={withSidebar && Boolean(doc.sidebar)}
/>
</div>
<main
className={[
Expand Down
22 changes: 13 additions & 9 deletions client/src/ui/organisms/article-actions-container/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,28 @@ import "./index.scss";
export const ArticleActionsContainer = ({
doc,
parents = doc?.parents,
withSidebar = true,
}: {
doc?: Doc;
parents?: DocParent[];
withSidebar?: boolean;
}) => {
const { isSidebarOpen, setIsSidebarOpen } = useUIStatus();

return (
<div className="article-actions-container">
<div className="container">
<Button
extraClasses="sidebar-button"
icon="sidebar"
type="action"
aria-label={isSidebarOpen ? "Collapse sidebar" : "Expand sidebar"}
aria-expanded={isSidebarOpen}
aria-controls="sidebar-quicklinks"
onClickHandler={() => setIsSidebarOpen(!isSidebarOpen)}
/>
{withSidebar && (
<Button
extraClasses="sidebar-button"
icon="sidebar"
type="action"
aria-label={isSidebarOpen ? "Collapse sidebar" : "Expand sidebar"}
aria-expanded={isSidebarOpen}
aria-controls="sidebar-quicklinks"
onClickHandler={() => setIsSidebarOpen(!isSidebarOpen)}
/>
)}

{/* if we have breadcrumbs for the current page, continue rendering the section */}
{parents && <Breadcrumbs parents={parents} />}
Expand Down

0 comments on commit 1de3c86

Please sign in to comment.