Skip to content
Snippets Groups Projects
Commit 26709f86 authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

fix css

parent 0fc66c2c
No related branches found
No related tags found
1 merge request!39auth
Pipeline #44037 passed with warnings
REACT_APP_BASE_URL_BACK=http://localhost:3001/api REACT_APP_BASE_URL_BACK=http://localhost:3001/api
REACT_APP_BASE_URL_FRONT=http://localhost:3000
\ No newline at end of file
...@@ -26,11 +26,12 @@ export default function Header({ selection, setSelection }) { ...@@ -26,11 +26,12 @@ export default function Header({ selection, setSelection }) {
}, [connected]); }, [connected]);
return ( return (
<div id="header-container"> <div id="header-container" style={!selection ? { flexDirection: "row" } : {}}>
<div id="header-restaurant-status"> <div id="header-restaurant-status">
{!selection {width &&
(!selection
? "Accueil" ? "Accueil"
: `${selection.name} : actuellement ${selection.status ? "ouvert" : "fermé"}`} : `${selection.name} : actuellement ${selection.status ? "ouvert" : "fermé"}`)}
</div> </div>
<Link id="header-home-link" to="/" onClick={() => setSelection(null)}> <Link id="header-home-link" to="/" onClick={() => setSelection(null)}>
<h2>{width || !selection ? "Eatfast" : selection.name}</h2> <h2>{width || !selection ? "Eatfast" : selection.name}</h2>
...@@ -44,6 +45,8 @@ export default function Header({ selection, setSelection }) { ...@@ -44,6 +45,8 @@ export default function Header({ selection, setSelection }) {
) )
) : user ? ( ) : user ? (
<BiLogOutCircle <BiLogOutCircle
id="header-button"
title="Déconnexion"
onClick={() => { onClick={() => {
localStorage.removeItem("user"); localStorage.removeItem("user");
window.location.assign(`${process.env.REACT_APP_BASE_URL_BACK}/auth/logout`); window.location.assign(`${process.env.REACT_APP_BASE_URL_BACK}/auth/logout`);
...@@ -51,6 +54,8 @@ export default function Header({ selection, setSelection }) { ...@@ -51,6 +54,8 @@ export default function Header({ selection, setSelection }) {
/> />
) : ( ) : (
<BiLogInCircle <BiLogInCircle
id="header-button"
title="Connexion"
onClick={() => { onClick={() => {
window.location.assign(`${process.env.REACT_APP_BASE_URL_BACK}/auth/login`); window.location.assign(`${process.env.REACT_APP_BASE_URL_BACK}/auth/login`);
}} }}
......
#header-container { #header-container {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: baseline; align-items: center;
padding-left: 1rem; padding-left: 1rem;
padding-right: 1rem; padding-right: 1rem;
background-color: rgb(33, 37, 41); background-color: rgb(33, 37, 41);
...@@ -24,15 +24,20 @@ ...@@ -24,15 +24,20 @@
font-weight: lighter; font-weight: lighter;
} }
#header-button {
height: 2rem;
width: 2rem;
}
#header-button:hover {
cursor: pointer;
}
@media only screen and (max-width: 600px) { @media only screen and (max-width: 600px) {
#header-home-link > h2 { #header-home-link > h2 {
font-size: 2rem; font-size: 2rem;
} }
#header-restaurant-status {
display: none;
}
#header-container { #header-container {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment