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

Commit

Permalink
Merge pull request #46 from quayside-app/ashton-logout-userface
Browse files Browse the repository at this point in the history
Ashton logout userface
  • Loading branch information
AKashton authored Nov 16, 2023
2 parents 1b9a551 + efbe104 commit 0254fa3
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 19 deletions.
192 changes: 174 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useState, useEffect } from 'react'
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 { useSession, 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,20 @@ 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 onClick={() => signOut()}>Sign Out</button>
</div>

{/* User Avatar Icon */}
{session && session.user && (
<div>
<img
src={session.user.image}
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 0254fa3

Please sign in to comment.