-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sectioned layout for project submission & view submitted project (#339)
- Loading branch information
Showing
4 changed files
with
62 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
frontend/src/templates/SectionedTemplate/SectionedTemplate.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { FC } from 'react'; | ||
import { AnchorLinkItem, AnchorLinks } from '@/components'; | ||
import { ReactNode } from '@tanstack/react-router'; | ||
|
||
export interface SectionedLayoutProps { | ||
children?: ReactNode; | ||
/* | ||
* asideTitle is the bolded title that goes before the links on the side | ||
*/ | ||
asideTitle: string; | ||
/* | ||
* links is an array of AnchorLinkItem which are passed to the component AnchorLinks | ||
*/ | ||
links: AnchorLinkItem[]; | ||
} | ||
|
||
/* | ||
* SectionedLayout is composed of a aside sticky links and a centered main content section. | ||
* The links are displayed using a | ||
*/ | ||
export const SectionedLayout: FC<SectionedLayoutProps> = ({ | ||
children, | ||
links, | ||
asideTitle, | ||
}) => { | ||
return ( | ||
<div> | ||
<nav | ||
data-testid="sectioned-layout-aside" | ||
className="fixed bottom-0 left-0 top-14 px-6 w-64" | ||
> | ||
<h1 className="text-lg font-bold mb-2">{asideTitle}</h1> | ||
<AnchorLinks links={links} /> | ||
</nav> | ||
<div data-testid="sectione-layout-main" className="pt-14 px-64"> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { DashboardTemplate } from './DashboardTemplate/DashboardTemplate'; | ||
export { SectionedLayout } from './SectionedTemplate/SectionedTemplate'; |