Стилевой фикс header

This commit is contained in:
Никита Потапов 2024-01-11 16:42:33 +04:00
parent 1b843b3810
commit ba30230395

View File

@ -3,6 +3,7 @@ import { Container, Navbar, Nav } from 'react-bootstrap';
import { Link, useLocation, useNavigate } from 'react-router-dom';
import { useContext } from 'react';
import { CurrentUserContext } from '../../contexts/CurrentUserContext';
import { Person } from 'react-bootstrap-icons';
const Header = ({ routes }) => {
const location = useLocation();
@ -19,7 +20,7 @@ const Header = ({ routes }) => {
return (
<header className='sticky-top'>
<Navbar expand='md'>
<Navbar expand='md bg-dark'>
<Container fluid>
<Navbar.Brand as={Link} to={indexPageLink?.path ?? '/'}>
Учебный процесс
@ -35,12 +36,12 @@ const Header = ({ routes }) => {
)
}
{
currentUser != null ? <div className='d-flex align-items-center d-md-none'>Привет, {currentUser.name} {currentUser.surname}!<button className='ms-3 btn btn-outline-danger btn-sm' onClick={() => { setCurrentUser(null); navigate('/'); }}>Выход</button></div> : ""
currentUser != null ? <div className='badge d-flex align-items-center d-md-none'><Person fill='white' className='me-1' /><span>{currentUser.name} {currentUser.surname}</span><button className='ms-3 btn btn-outline-danger btn-sm' onClick={() => { setCurrentUser(null); navigate('/'); }}>Выход</button></div> : ""
}
</Nav>
</Navbar.Collapse>
{
currentUser ? <div className='d-none d-md-block me-3'>Привет, {currentUser.name} {currentUser.surname}!</div> : ""
currentUser ? <div className='badge d-none d-md-flex align-items-center me-3'><Person fill='white' className='me-1' /><span>{currentUser.name} {currentUser.surname}</span></div> : ""
}
{
currentUser ? <button className='btn btn-outline-danger btn-sm d-none d-md-block' onClick={() => { setCurrentUser(null); navigate('/'); }}>Выход</button> : ''