Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
added signout and icon
Browse files Browse the repository at this point in the history
  • Loading branch information
AKashton committed Nov 15, 2023
1 parent ac812ea commit 4192570
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Image from 'next/image'
import searchIcon from '../../public/svg/search.svg'
import logo from '../../public/quaysideLogo.png'
import { useSession } from 'next-auth/react'

import { signOut } from 'next-auth/react'
/**
* A Navbar component that fetches a user's name from a specified API and displays a navigation bar with several interactive elements.
*
Expand Down Expand Up @@ -89,6 +89,21 @@ const Navbar = () => {
</div>
</div>

{/*Sign Out*/}
<div className='flex w-2/12 lg:w-1/12 justify-end my-auto text-right px-2'>
<button className="signout-button" onClick={() => signOut()}>Sign Out</button>
</div>

{/* User Avatar Icon */}
{session && session.user && (
<div className="avatar-container">
<img
src={session.user.image}
alt="User Avatar"
style={{ width: '40px', height: '40px', borderRadius: '50%' }}
/>
</div>
)}
{/* User */}
<div className='flex w-2/12 lg:w-1/12 justify-end my-auto text-right px-2'> {name} </div>

Expand Down

0 comments on commit 4192570

Please sign in to comment.