first commit

This commit is contained in:
Romulus21
2024-02-10 14:59:46 +01:00
commit 5bb0b25673
193 changed files with 28660 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import React from "react"
import {Link, useLocation} from "react-router-dom"
import useAuthUser from "../hooks/AuthUser";
import Tracker from "./Tracker";
const Header = () => {
const {authUser} = useAuthUser()
const location = useLocation()
console.log(authUser)
return <header className="flex justify-between py-3 px-5 bg-blue-700 text-white text-xl">
<div>
<Link to="/">Ticcat</Link>
</div>
{authUser && <Tracker />}
{authUser
? <span className="flex gap-2">
<Link to="/profile" className={location.pathname === '/profile' ? 'font-bold' : ''}>{authUser.name}</Link>
</span>
: <span className="flex gap-2">
<Link to="/connexion">Connexion</Link>
{/*<Link to="/sinscrire">S'inscrire</Link>*/}
</span>}
</header>
}
export default Header