-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created sidebar, links hidden when user is signed out (#149)
* Created sidebar, links hidden when user is signed out > > Co-authored by: Hannah McGowan <[email protected] * added links to student and para tables, settings page under construction * redirect to students page upon login * updated table title * ran prettier on navbar styles * added type to Navbar props * resolved all issues except 401 error, fixed linting * removed React.FC, updated prop type * Pascal Casing * updated component exports * Fixed export casing
- Loading branch information
1 parent
86d086f
commit fd38806
Showing
10 changed files
with
224 additions
and
61 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,72 @@ | ||
import React from "react"; | ||
import styles from "../styles/Navbar.module.css"; | ||
import Link from "next/link"; | ||
import Image from "next/image"; | ||
import { | ||
PeopleOutline, | ||
CoPresent, | ||
Settings, | ||
Logout, | ||
} from "@mui/icons-material"; | ||
import { signOut } from "next-auth/react"; | ||
import { trpc } from "@/client/lib/trpc"; | ||
|
||
interface NavBarProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
const NavBar = ({ children }: NavBarProps) => { | ||
const { data: me } = trpc.user.getMe.useQuery(); | ||
|
||
return ( | ||
<React.Fragment> | ||
<div className={styles.container}> | ||
<div className={styles.sidebar}> | ||
<Link href="/"> | ||
<Image | ||
src="/img/compass-logo.svg" | ||
alt="logo" | ||
className={styles.logo} | ||
width={64} | ||
height={64} | ||
priority | ||
/> | ||
</Link> | ||
<br /> | ||
|
||
{me && ( | ||
<div className={styles.linkContainer}> | ||
<Link href="/students" className={styles.link}> | ||
<PeopleOutline className={styles.icon} /> | ||
<p className={styles.linkTitle}>Students</p> | ||
</Link> | ||
<br /> | ||
<Link href="/staff" className={styles.link}> | ||
<CoPresent className={styles.icon} /> | ||
<p className={styles.linkTitle}>Staff</p> | ||
</Link> | ||
<br /> | ||
<Link href="/settings" className={styles.link}> | ||
<Settings className={styles.icon} /> | ||
<p className={styles.linkTitle}>Settings</p> | ||
</Link> | ||
<br /> | ||
<Link href="" className={styles.link}> | ||
<Logout className={styles.icon} /> | ||
<p | ||
className={styles.linkTitle} | ||
onClick={() => signOut({ callbackUrl: "/" })} | ||
> | ||
Logout | ||
</p> | ||
</Link> | ||
</div> | ||
)} | ||
</div> | ||
<div className={styles.body}>{children}</div> | ||
</div> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default NavBar; |
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
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,11 @@ | ||
import React from "react"; | ||
|
||
const Settings = () => { | ||
return ( | ||
<div> | ||
<p>🚧 Under Construction! 🚧</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Settings; |
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,26 @@ | ||
import React from "react"; | ||
import styles from "../../styles/Dashboard.module.css"; | ||
import MyParas from "@/components/case_manager/MyParas"; | ||
|
||
function Staff() { | ||
return ( | ||
<div className={styles.cmContainer}> | ||
<nav style={{ padding: "2%" }}></nav> | ||
<main> | ||
<div style={{ padding: "20px", textAlign: "center" }}> | ||
<div | ||
style={{ | ||
display: "flex", | ||
alignContent: "center", | ||
justifyContent: "center", | ||
}} | ||
> | ||
<MyParas /> | ||
</div> | ||
</div> | ||
</main> | ||
</div> | ||
); | ||
} | ||
|
||
export default Staff; |
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
Oops, something went wrong.