|
|
|
@ -9,9 +9,7 @@ import Image from 'next/image';
|
|
|
|
import { FiArrowRight } from 'react-icons/fi';
|
|
|
|
import { FiArrowRight } from 'react-icons/fi';
|
|
|
|
|
|
|
|
|
|
|
|
const NavBar = () => {
|
|
|
|
const NavBar = () => {
|
|
|
|
|
|
|
|
|
|
|
|
const navRef = useRef<HTMLInputElement>();
|
|
|
|
const navRef = useRef<HTMLInputElement>();
|
|
|
|
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
const router = useRouter();
|
|
|
|
const { data: session, status } = useSession();
|
|
|
|
const { data: session, status } = useSession();
|
|
|
|
console.log('role', session)
|
|
|
|
console.log('role', session)
|
|
|
|
@ -48,11 +46,8 @@ const NavBar = () => {
|
|
|
|
{!session && <><Link href="/connexion" legacyBehavior><a className={style.link} >Connexion</a></Link></>}
|
|
|
|
{!session && <><Link href="/connexion" legacyBehavior><a className={style.link} >Connexion</a></Link></>}
|
|
|
|
{session && <><Link href="/mon-compte" legacyBehavior><a className={style.link} >Mon compte</a></Link><p>|</p></>}
|
|
|
|
{session && <><Link href="/mon-compte" legacyBehavior><a className={style.link} >Mon compte</a></Link><p>|</p></>}
|
|
|
|
{session && <><Link href="#" legacyBehavior><a onClick={() => logout()} className={style.link} >Se déconnecter</a></Link></>}
|
|
|
|
{session && <><Link href="#" legacyBehavior><a onClick={() => logout()} className={style.link} >Se déconnecter</a></Link></>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{session && <span className={`${style.connexion} badge rounded-pill bg-light text-dark`}>Vous-êtes connecté <FiArrowRight /> {session.user.email}</span>}
|
|
|
|
{session && <span className={`${style.connexion} badge rounded-pill bg-light text-dark`}>Vous-êtes connecté <FiArrowRight /> {session.user.email}</span>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={`justify-content-center text-center ${style['show-mobile']}`}>
|
|
|
|
<div className={`justify-content-center text-center ${style['show-mobile']}`}>
|
|
|
|
<span className={`${style.burgerButton}`} onClick={openNav}>☰</span>
|
|
|
|
<span className={`${style.burgerButton}`} onClick={openNav}>☰</span>
|
|
|
|
|