Instantly share code, notes, and snippets.
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save Taofiqq/5fe986309bf2bdbf7eb7edd4249960cd to your computer and use it in GitHub Desktop.
Navbar and Footer Component
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
import Link from "next/link"; | |
import styles from "../styles/Footer.module.css"; | |
const Footer = () => { | |
return ( | |
<div className={styles.container}> | |
<h1 className={styles.text}> | |
Built with{" "} | |
<Link href="https://nextjs.org/"> | |
<span className={styles.stack}>Nextjs</span> | |
</Link>{" "} | |
and{" "} | |
<Link href="https://supabase.com/"> | |
<span className={styles.stack}>Supabase</span> | |
</Link> | |
</h1> | |
<Link href=""> | |
<p className={styles.repo}>Github Repo</p> | |
</Link> | |
</div> | |
); | |
}; | |
export default Footer; |
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
.container { | |
border-top: 1px solid #d8d8d8; | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; | |
color: #d8d8d8; | |
padding-bottom: 1.5rem; | |
} | |
.text { | |
margin-top: 2rem; | |
} | |
.repo { | |
text-decoration: underline; | |
cursor: pointer; | |
margin-top: 1rem; | |
} | |
.stack { | |
color: #f35815; | |
cursor: pointer; | |
} |
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
import Link from "next/link"; | |
import styles from "../styles/Navbar.module.css"; | |
import { supabase } from "../utils/supabase"; | |
const Navbar = ({ session }) => { | |
return ( | |
<div className={styles.container}> | |
<div> | |
<p className={styles.title}>Adrenargy</p> | |
</div> | |
{session?.user ? ( | |
<ul className={styles.navContent}> | |
<Link href="/"> | |
<li className={styles.name}>Home</li> | |
</Link> | |
<button | |
className={styles.buttons} | |
onClick={() => supabase.auth.signOut()} | |
> | |
Logout | |
</button> | |
<Link href="/create"> | |
<button className={styles.buttons}>Create New Workout</button> | |
</Link> | |
</ul> | |
) : ( | |
<ul className={styles.navContent}> | |
<Link href="/login"> | |
<li className={styles.buttons}>Login</li> | |
</Link> | |
<Link href="/signup"> | |
<li className={styles.buttons}>Signup</li> | |
</Link> | |
</ul> | |
)} | |
</div> | |
); | |
}; | |
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
.container { | |
color: #d8d8d8; | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
padding: 2rem 3rem; | |
} | |
.navContent { | |
display: flex; | |
align-items: center; | |
} | |
.title { | |
font-size: 1.5rem; | |
font-weight: 500; | |
} | |
.name { | |
margin-right: 2rem; | |
color: #f35815; | |
cursor: pointer; | |
} | |
.buttons { | |
border: 1px solid #f35815; | |
background-color: transparent; | |
color: #d8d8d8; | |
padding: 0.5rem 2rem; | |
border-radius: 0.4rem; | |
cursor: pointer; | |
transition: all 0.3s ease-in-out; | |
margin-right: 1.5rem; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment