2022-07-28 23:55:18 +02:00
|
|
|
import {
|
|
|
|
AppBar,
|
|
|
|
Toolbar,
|
|
|
|
Container,
|
|
|
|
Typography,
|
|
|
|
Skeleton,
|
|
|
|
} from '@mui/material';
|
2022-07-28 19:56:05 +02:00
|
|
|
import { useContext } from 'react';
|
|
|
|
import { Link } from 'react-router-dom';
|
2022-07-28 19:39:06 +02:00
|
|
|
|
|
|
|
import '../css/Header.css';
|
|
|
|
import { Context } from '../data/Context';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a Header Component that displays the reservation steps
|
|
|
|
* @return {JSX.Element}
|
|
|
|
*/
|
|
|
|
export default function Header() {
|
2022-07-29 00:36:15 +02:00
|
|
|
const { title, containerMaxWidth } = useContext(Context);
|
2022-08-02 10:17:05 +02:00
|
|
|
|
|
|
|
const logoContainerStyle = {
|
|
|
|
textDecoration: 'none',
|
|
|
|
color: 'inherit',
|
|
|
|
margin: '0 0 0 0',
|
|
|
|
width: 'fit-content',
|
|
|
|
padding: '0 0 0 0 !important',
|
|
|
|
};
|
|
|
|
|
2022-07-28 19:39:06 +02:00
|
|
|
return (
|
|
|
|
<AppBar position='sticky'>
|
2022-07-29 00:36:15 +02:00
|
|
|
<Container maxWidth={containerMaxWidth} className='header-container'>
|
2022-07-28 19:39:06 +02:00
|
|
|
<Toolbar className='header-container'>
|
2022-08-02 10:17:05 +02:00
|
|
|
<Container
|
|
|
|
sx={{
|
|
|
|
...logoContainerStyle,
|
|
|
|
display: { xs: 'none', md: 'block' },
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Link to='/'>
|
|
|
|
<img src='/badge-white.png' className='header-icon'></img>
|
|
|
|
</Link>
|
|
|
|
</Container>
|
|
|
|
<Container
|
|
|
|
sx={{
|
|
|
|
...logoContainerStyle,
|
|
|
|
display: { xs: 'block', md: 'none' },
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Link to='/'>
|
|
|
|
<img src='/logo192.png' className='header-icon'></img>
|
|
|
|
</Link>
|
|
|
|
</Container>
|
2022-07-28 19:39:06 +02:00
|
|
|
<Typography variant='h6'>{title}</Typography>
|
2022-07-28 23:55:18 +02:00
|
|
|
{title === '' && <Skeleton height={20} width={200}></Skeleton>}
|
2022-07-28 19:39:06 +02:00
|
|
|
</Toolbar>
|
|
|
|
</Container>
|
|
|
|
</AppBar>
|
|
|
|
);
|
|
|
|
}
|