[5d6f37a] | 1 | // @mui
|
---|
| 2 | import { useTheme } from '@mui/material/styles';
|
---|
| 3 | import Link from '@mui/material/Link';
|
---|
| 4 | import Stack from '@mui/material/Stack';
|
---|
| 5 | import AppBar from '@mui/material/AppBar';
|
---|
| 6 | import Toolbar from '@mui/material/Toolbar';
|
---|
| 7 | // theme
|
---|
| 8 | import { bgBlur } from 'src/theme/css';
|
---|
| 9 | // routes
|
---|
| 10 | import { RouterLink } from 'src/routes/components';
|
---|
| 11 | // hooks
|
---|
| 12 | import { useOffSetTop } from 'src/hooks/use-off-set-top';
|
---|
| 13 | // components
|
---|
| 14 | import Logo from 'src/components/logo';
|
---|
| 15 | //
|
---|
| 16 | import { HEADER } from '../config-layout';
|
---|
| 17 | import HeaderShadow from './header-shadow';
|
---|
| 18 | import SettingsButton from './settings-button';
|
---|
| 19 |
|
---|
| 20 | // ----------------------------------------------------------------------
|
---|
| 21 |
|
---|
| 22 | export default function HeaderSimple() {
|
---|
| 23 | const theme = useTheme();
|
---|
| 24 |
|
---|
| 25 | const offsetTop = useOffSetTop(HEADER.H_DESKTOP);
|
---|
| 26 |
|
---|
| 27 | return (
|
---|
| 28 | <AppBar>
|
---|
| 29 | <Toolbar
|
---|
| 30 | sx={{
|
---|
| 31 | justifyContent: 'space-between',
|
---|
| 32 | height: {
|
---|
| 33 | xs: HEADER.H_MOBILE,
|
---|
| 34 | md: HEADER.H_DESKTOP,
|
---|
| 35 | },
|
---|
| 36 | transition: theme.transitions.create(['height'], {
|
---|
| 37 | easing: theme.transitions.easing.easeInOut,
|
---|
| 38 | duration: theme.transitions.duration.shorter,
|
---|
| 39 | }),
|
---|
| 40 | ...(offsetTop && {
|
---|
| 41 | ...bgBlur({
|
---|
| 42 | color: theme.palette.background.default,
|
---|
| 43 | }),
|
---|
| 44 | height: {
|
---|
| 45 | md: HEADER.H_DESKTOP_OFFSET,
|
---|
| 46 | },
|
---|
| 47 | }),
|
---|
| 48 | }}
|
---|
| 49 | >
|
---|
| 50 | <Logo />
|
---|
| 51 |
|
---|
| 52 | <Stack direction="row" alignItems="center" spacing={1}>
|
---|
| 53 | <SettingsButton />
|
---|
| 54 |
|
---|
| 55 | <Link href="/" component={RouterLink} color="inherit" sx={{ typography: 'subtitle2' }}>
|
---|
| 56 | Need help?
|
---|
| 57 | </Link>
|
---|
| 58 | </Stack>
|
---|
| 59 | </Toolbar>
|
---|
| 60 |
|
---|
| 61 | {offsetTop && <HeaderShadow />}
|
---|
| 62 | </AppBar>
|
---|
| 63 | );
|
---|
| 64 | }
|
---|