-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from hngx-org/v2
V2
- Loading branch information
Showing
8 changed files
with
195 additions
and
14 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use client'; | ||
|
||
import React from 'react'; | ||
import HomeFooter from '@/components/home/Footer'; | ||
import NavBar from '@/components/home/NavBar'; | ||
import NavBarAuthenticated from '@/components/Header/NavBarAuthenticated'; | ||
import { CheckAuthFromLocalStorage } from '@/helpers/auth'; | ||
|
||
export default function GeneralTemplate({ children }: { children: React.ReactNode }) { | ||
const Authenticated = CheckAuthFromLocalStorage(); | ||
return ( | ||
<> | ||
{Authenticated ? <NavBarAuthenticated /> : <NavBar />} | ||
{children} | ||
{!Authenticated && <HomeFooter />} | ||
</> | ||
); | ||
} |
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,7 @@ | ||
import React from 'react'; | ||
|
||
const NavBarAuthenticated = () => { | ||
return <div>NavBarAuthenticated</div>; | ||
}; | ||
|
||
export default NavBarAuthenticated; |
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,6 @@ | ||
export function CheckAuthFromLocalStorage(): string | null { | ||
if (typeof window !== 'undefined') { | ||
return localStorage.getItem('authenticated') as string | null; | ||
} | ||
return null; | ||
} |
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