react-version #1

Merged
memartel_loc merged 290 commits from react-version into main 2023-11-04 09:48:15 -04:00
Showing only changes of commit 1db9a273a0 - Show all commits

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>