speed-flowchart-web/src/components/Header.tsx

34 lines
957 B
TypeScript
Raw Normal View History

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-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'>
<Link to='/' style={{ textDecoration: 'none', color: 'inherit' }}>
2022-07-29 12:55:59 +02:00
<img src='/badge-white.png' className='header-icon'></img>
2022-07-28 19:39:06 +02:00
</Link>
<Typography variant='h6'>{title}</Typography>
{title === '' && <Skeleton height={20} width={200}></Skeleton>}
2022-07-28 19:39:06 +02:00
</Toolbar>
</Container>
</AppBar>
);
}