Update Topbar.js

This commit is contained in:
MarcEricMartel 2022-11-06 04:55:24 -08:00
parent 3f6c303865
commit 1db9a273a0

View File

@ -1,12 +1,12 @@
import React from "react";
import React, { useEffect, useState } from "react";
import Container from 'react-bootstrap/Container';
import Nav from 'react-bootstrap/Nav';
import Navbar from 'react-bootstrap/Navbar';
import { Link } from "react-router-dom";
import Dropdown from "react-bootstrap/Dropdown";
const Topbar = () => {
const user = null;
return (
<Navbar expand="sm" className="topbar-container">
<Container>
@ -31,12 +31,22 @@ const Topbar = () => {
<Link className="nav-link" to="/privacy" >
Vie privée
</Link>
{user !== null && user.hasCookie === false &&
<Link className="nav-link" to="/login" >
Connexion
</Link>
}
{user !== null && user.hasCookie === false &&
<Link className="nav-link" to="/register">
S'inscrire
</Link>
}
{user !== null && user.hasCookie === true &&
<Link className="nav-link" to="/logout" >
Déconnexion
</Link>
}
{user !== null && user.hasCookie === true && user.role === "Administrateur" &&
<Dropdown className="dropdown-gestion-container">
<Dropdown.Toggle className="dropdown-gestion" >
Gestion
@ -50,6 +60,7 @@ const Topbar = () => {
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
}
</Nav>
</Navbar.Collapse>
</Container>