Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions app/(root)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
"use client";

import styled from "styled-components";
import GlobalBlackBar from "../components/GlobalBlackBar";
import Sidebar from "../components/Sidebar";
import TopBar from "../components/TopBar";

export default function BethesourceLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<GlobalBlackBar />
<LayoutContainer>
<Sidebar
// TODO: Implement all of these
isCollapsed={false}
setIsCollapsed={() => {}}
isLoggedIn={false}
setIsLoggedIn={() => {}}
cartItemCount={0}
/>
{children}
</LayoutContainer>
</>
<Container>
{/* The Sidebar sits on the left. It no longer needs props */}
<Sidebar />

{/* The MainContent column sits on the right */}
<MainContent>
<TopBar />
<ContentArea>{children}</ContentArea>
</MainContent>
</Container>
);
}

const LayoutContainer = styled.div`
// --- Layout Styles ---

const Container = styled.div`
display: flex;
width: 100vw;
height: 100vh;
overflow: hidden; /* Prevents the whole page from scrolling */
`;

const MainContent = styled.div`
display: flex;
flex-direction: row;
width: 100%;
height: 100%;
flex-direction: column;
flex: 1; /* Takes up all width not used by Sidebar */
min-width: 0; /* Prevents flexbox overflow issues */
`;

const ContentArea = styled.main`
flex: 1; /* Takes up all height not used by TopBar */
overflow-y: auto; /* Allows only this area to scroll */
background-color: #f9fafb; /* Light gray background for content */
`;
Loading