Skip to content
Snippets Groups Projects

auth

3 files
+ 20
11
Compare changes
  • Side-by-side
  • Inline

Files

+ 9
4
@@ -26,11 +26,12 @@ export default function Header({ selection, setSelection }) {
}, [connected]);
return (
<div id="header-container">
<div id="header-container" style={!selection ? { flexDirection: "row" } : {}}>
<div id="header-restaurant-status">
{!selection
? "Accueil"
: `${selection.name} : actuellement ${selection.status ? "ouvert" : "fermé"}`}
{width &&
(!selection
? "Accueil"
: `${selection.name} : actuellement ${selection.status ? "ouvert" : "fermé"}`)}
</div>
<Link id="header-home-link" to="/" onClick={() => setSelection(null)}>
<h2>{width || !selection ? "Eatfast" : selection.name}</h2>
@@ -44,6 +45,8 @@ export default function Header({ selection, setSelection }) {
)
) : user ? (
<BiLogOutCircle
id="header-button"
title="Déconnexion"
onClick={() => {
localStorage.removeItem("user");
window.location.assign(`${process.env.REACT_APP_BASE_URL_BACK}/auth/logout`);
@@ -51,6 +54,8 @@ export default function Header({ selection, setSelection }) {
/>
) : (
<BiLogInCircle
id="header-button"
title="Connexion"
onClick={() => {
window.location.assign(`${process.env.REACT_APP_BASE_URL_BACK}/auth/login`);
}}
Loading