-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
got formatting and display issues ironed out. saving state just in ca…
…se i break it again later on
- Loading branch information
1 parent
3e908b1
commit d76a921
Showing
12 changed files
with
200 additions
and
315 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,87 @@ | ||
"use client"; | ||
import * as React from "react"; | ||
import {subtitle, title} from "@/config/primitives"; | ||
import {redirect, usePathname} from "next/navigation"; | ||
import {useSession} from "next-auth/react"; | ||
import {Box, Stack} from "@mui/joy"; | ||
import Sidebar from "@/components/sidebar"; | ||
import Divider from "@mui/joy/Divider"; | ||
import Header from "@/components/header"; | ||
|
||
export default function EndpointLayout({children,}: { children: React.ReactNode }) { | ||
useSession({ | ||
required: true, | ||
onUnauthenticated() { | ||
redirect('/login'); | ||
}, | ||
}); | ||
|
||
function renderSwitch(endpoint: string) { | ||
switch (endpoint) { | ||
case '/dashboard': | ||
return ( | ||
<> | ||
<h3 className={title({color: "cyan"})} key={endpoint}>Dashboard View</h3> | ||
</> | ||
) | ||
case '/data': | ||
return ( | ||
<> | ||
<h2 className={title({color: "green"})} key={endpoint}>Data Hub</h2> | ||
</> | ||
) | ||
case '/files': | ||
return ( | ||
<> | ||
<h3 className={title({color: "pink"})} key={endpoint}>File Hub</h3> | ||
</> | ||
) | ||
default: | ||
return ( | ||
<> | ||
</> | ||
); | ||
} | ||
} | ||
|
||
let pathname = usePathname(); | ||
return ( | ||
<> | ||
{/*<Stack direction={"row"}>*/} | ||
{/*</Stack>*/} | ||
<Sidebar/> | ||
<Header /> | ||
<Box | ||
component="main" | ||
className="MainContent" | ||
sx={{ | ||
marginLeft: '25px', | ||
marginTop: 'var(--Header-height)', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
minWidth: 0, | ||
gap: 1, | ||
flexGrow: 1, | ||
flexShrink: 1, | ||
}} | ||
> | ||
<Box sx={{display: 'flex', alignItems: 'left', paddingTop: '25px', paddingBottom: '25px'}}> | ||
{renderSwitch(pathname)} | ||
</Box> | ||
<Box sx={{display: 'flex', alignItems: 'center'}}> | ||
{children} | ||
</Box> | ||
<Box mt={3} position="absolute" bottom="25px" right="calc(40% - var(--Sidebar-width))" | ||
sx={{display: 'flex', alignItems: 'center', flexDirection: 'row'}}> | ||
<Box> | ||
<h1 className={title({color: "violet"})}>ForestGEO </h1> | ||
</Box> | ||
<Divider orientation={"vertical"} sx={{marginRight: 2}}/> | ||
<Box> | ||
<p className={subtitle({color: "cyan"})}>A data entry and validation system for your convenience.</p> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {Card, CardCover, Link} from '@mui/joy'; | ||
import {CardContent} from "@mui/joy"; | ||
import Typography from "@mui/joy/Typography"; | ||
|
||
import Image from 'next/image'; | ||
import NextLink from 'next/link'; | ||
|
||
export function TemplateCard(image: any, cardIcon: any, cardTitle: string, cardLink: string) { | ||
return ( | ||
<> | ||
{/*<Card sx={{ minHeight: '280px', maxWidth: '350px'}}>*/} | ||
<Card> | ||
<CardCover> | ||
<Image | ||
src={image} | ||
alt="" | ||
/> | ||
</CardCover> | ||
<CardCover | ||
sx={{ | ||
background: | ||
'linear-gradient(to top, rgba(0,0,0,0.4), rgba(0,0,0,0) 200px), linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0) 300px)', | ||
}} | ||
/> | ||
<CardContent sx={{ justifyContent: 'flex-end' }}> | ||
<Typography level="title-lg" textColor="#fff"> | ||
<Link | ||
component={NextLink} | ||
overlay | ||
underline="none" | ||
href={cardLink} | ||
sx={{ color: 'text.tertiary' }} | ||
> | ||
{cardTitle} | ||
</Link> | ||
</Typography> | ||
<Typography | ||
startDecorator={cardIcon} | ||
textColor="neutral.300" | ||
> | ||
View and Edit | ||
</Typography> | ||
</CardContent> | ||
</Card> | ||
</> | ||
); | ||
} |
Oops, something went wrong.