Update Topbar.js
This commit is contained in:
parent
3f6c303865
commit
1db9a273a0
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user