Skip to content

Commit

Permalink
removing burger
Browse files Browse the repository at this point in the history
  • Loading branch information
cameochoquer committed Aug 3, 2023
1 parent 9e7dd88 commit b344165
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ const Header = () => {
const router = useRouter()
const supabase = createClientComponentClient<Database>()

// useEffect(() => {
// check whether user is logged in
const getSession = async () => {
const {
data: { session },
} = await supabase.auth.getSession()
if (session) return setSession(session)
}
getSession()
// }, [])

useEffect(() => {
// check whether user is logged in
const getSession = async () => {
const {
data: { session },
} = await supabase.auth.getSession()
if (session) return setSession(session)
console.log(session.user.user_metadata.role_id)
}
getSession()
}, [])
const handleLogout = async () => {
await supabase.auth.signOut()
setSession(null)
Expand All @@ -39,9 +39,9 @@ const Header = () => {
<Navbar fluid rounded>
{showSidebar ? <HamburgerSidebar /> : null}
<div className="flex gap-3 items-center">
<button onClick={() => setShowSidebar(!showSidebar)}>
{/* <button onClick={() => setShowSidebar(!showSidebar)}>
<RxHamburgerMenu className="invert scale-125 mx-2 dark:text-gray-500" />
</button>
</button> */}
<Navbar.Brand href="/" className="flex gap-3 items-center">
{
<Image
Expand Down Expand Up @@ -76,7 +76,13 @@ const Header = () => {
{session.user.email}
</span>
</Dropdown.Header>
<Dropdown.Item>Settings</Dropdown.Item>
<Link href="/search-preferences">
<Dropdown.Item>Search</Dropdown.Item>
</Link>
<Link href="/favourites">
<Dropdown.Item>favourites</Dropdown.Item>
</Link>

{session.user.user_metadata.role_id === 2 ? (
<>
<Dropdown.Divider />
Expand Down

0 comments on commit b344165

Please sign in to comment.