Skip to content

Commit

Permalink
Merge pull request #9 from lugvitc/main
Browse files Browse the repository at this point in the history
Deploy v7?
  • Loading branch information
WizzyGeek authored Jun 20, 2024
2 parents 15d0ec3 + 950df30 commit 13f4173
Show file tree
Hide file tree
Showing 3 changed files with 505 additions and 444 deletions.
73 changes: 40 additions & 33 deletions src/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
import { Link } from "react-router-dom";

import './navbar.scss'
import "./navbar.scss";
import { useContext, useEffect, useRef } from "react";
import { SessionContext, supabase } from "../supabase";

export default function NavBar() {
const session = useContext(SessionContext);
const session = useContext(SessionContext);

const nref = useRef<null | HTMLElement>(null);
useEffect(() => {
document
.querySelector<HTMLElement>(":root")!
.style.setProperty(
"--nav-height",
nref.current!.offsetHeight.toString() + "px"
)
})
const nref = useRef<null | HTMLElement>(null);
useEffect(() => {
document
.querySelector<HTMLElement>(":root")!
.style.setProperty(
"--nav-height",
nref.current!.offsetHeight.toString() + "px",
);
});

return (
<nav ref={nref}>
<div className=" max-w-[100rem] pnav lg:mx-auto xl:px-16">
<div className="flex items-center gap-4 sec-left">
<img className="h-10" src="/favicon.ico" />
<div className="p-2 font-montserrat">
<a href="https://lugvitc.net">LUGVITC</a>
</div>
</div>
<div className=" flex justify-center items-center gap-4 sm:gap-8">
<Link to="/">Home</Link>
<Link to="/apply">Apply</Link>
{session !== null ? (
<button
onClick={() =>
supabase.auth.signOut().then(({ error }) => {
error && console.log(error);
})
}
>
Log Out
</button>
) : null}
</div>
</div>
</nav>
);
}

return (
<nav ref={nref}>
<div className=" max-w-[100rem] pnav lg:mx-auto xl:px-16">
<div className="flex items-center gap-4 sec-left">
<img className="h-10" src="/favicon.ico"/>
<div className=" border p-2 font-montserrat">LUGVITC</div>
</div>
<div className=" flex justify-center items-center gap-4 sm:gap-8">
<Link to="/">Home</Link>
<Link to="/apply">Apply</Link>
{
session !== null ? (
<button onClick={() => supabase.auth.signOut().then(({error}) => {
error && console.log(error);
})}>Log Out</button>
) : null
}
</div>
</div>
</nav>
)
}
Loading

0 comments on commit 13f4173

Please sign in to comment.