File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 45
45
46
46
/* Medium Devices, Desktops */
47
47
@media only screen and (min-width : 992px ) {
48
- .main {
48
+ .main . hasNavBar {
49
49
margin-left : 200px ;
50
50
}
51
51
}
Original file line number Diff line number Diff line change @@ -3,18 +3,21 @@ import NavBar from "../navbar/NavBar";
3
3
import $layout from "./Layout.module.css" ;
4
4
import { useRouter } from "next/router" ;
5
5
import { requiresLogin } from "@/client/lib/authenticated-page" ;
6
+ import { useSession } from "next-auth/react" ;
6
7
7
8
interface LayoutProps {
8
9
children : React . ReactNode ;
9
10
}
10
11
11
12
const Layout = ( { children } : LayoutProps ) => {
12
13
const router = useRouter ( ) ;
14
+ const { status } = useSession ( ) ;
13
15
// TODO?: Are there better ways to achieve this?
14
16
//Sets purple background for student profile and instructions routes
15
17
const isPurpleBg =
16
18
router . asPath . includes ( "/studentprofile" ) ||
17
19
router . asPath . includes ( "/instructions" ) ;
20
+ const hasNavBar = "authenticated" == status ;
18
21
19
22
return (
20
23
< div className = { $layout . container } >
@@ -24,7 +27,8 @@ const Layout = ({ children }: LayoutProps) => {
24
27
${ router . query . student_id ? $layout . mainStudent : "" }
25
28
${ router . query . goal_id ? $layout . mainGoal : "" }
26
29
${ router . query . user_id ? $layout . mainStaff : "" }
27
- ${ router . pathname . includes ( "benchmarks" ) ? $layout . mainPurple : "" } ` }
30
+ ${ router . pathname . includes ( "benchmarks" ) ? $layout . mainPurple : "" }
31
+ ${ hasNavBar ? $layout . hasNavBar : "" } ` }
28
32
>
29
33
{ children }
30
34
</ main >
You can’t perform that action at this time.
0 commit comments