|
|
@ -1,54 +1,66 @@ |
|
|
|
import { useState } from 'react'; |
|
|
|
import { useState } from 'react'; |
|
|
|
import AppBar from '@material-ui/core/AppBar'; |
|
|
|
import { styled } from '@mui/material/styles'; |
|
|
|
import { makeStyles } from '@material-ui/core/styles'; |
|
|
|
import { AppBar, Box, Button } from '@mui/material'; |
|
|
|
import { Box, Button } from '@material-ui/core'; |
|
|
|
|
|
|
|
import { ICONS, ICON_SIZE } from '../lib/consts/ICONS'; |
|
|
|
import { ICONS, ICON_SIZE } from '../lib/consts/ICONS'; |
|
|
|
import { BORDER_RADIUS, RED } from '../lib/consts/DEFAULT_THEME'; |
|
|
|
import { BORDER_RADIUS, RED } from '../lib/consts/DEFAULT_THEME'; |
|
|
|
import AnvilDrawer from './AnvilDrawer'; |
|
|
|
import AnvilDrawer from './AnvilDrawer'; |
|
|
|
|
|
|
|
|
|
|
|
const useStyles = makeStyles((theme) => ({ |
|
|
|
const PREFIX = 'Header'; |
|
|
|
appBar: { |
|
|
|
|
|
|
|
paddingTop: theme.spacing(0.5), |
|
|
|
const classes = { |
|
|
|
paddingBottom: theme.spacing(0.5), |
|
|
|
input: `${PREFIX}-input`, |
|
|
|
paddingLeft: theme.spacing(3), |
|
|
|
barElement: `${PREFIX}-barElement`, |
|
|
|
paddingRight: theme.spacing(3), |
|
|
|
iconBox: `${PREFIX}-iconBox`, |
|
|
|
borderBottom: 'solid 1px', |
|
|
|
searchBar: `${PREFIX}-searchBar`, |
|
|
|
borderBottomColor: RED, |
|
|
|
icons: `${PREFIX}-icons`, |
|
|
|
}, |
|
|
|
}; |
|
|
|
input: { |
|
|
|
|
|
|
|
|
|
|
|
const StyledAppBar = styled(AppBar)(({ theme }) => ({ |
|
|
|
|
|
|
|
paddingTop: theme.spacing(0.5), |
|
|
|
|
|
|
|
paddingBottom: theme.spacing(0.5), |
|
|
|
|
|
|
|
paddingLeft: theme.spacing(3), |
|
|
|
|
|
|
|
paddingRight: theme.spacing(3), |
|
|
|
|
|
|
|
borderBottom: 'solid 1px', |
|
|
|
|
|
|
|
borderBottomColor: RED, |
|
|
|
|
|
|
|
position: 'static', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[`& .${classes.input}`]: { |
|
|
|
height: '2.8em', |
|
|
|
height: '2.8em', |
|
|
|
width: '30vw', |
|
|
|
width: '30vw', |
|
|
|
backgroundColor: theme.palette.secondary.main, |
|
|
|
backgroundColor: theme.palette.secondary.main, |
|
|
|
borderRadius: BORDER_RADIUS, |
|
|
|
borderRadius: BORDER_RADIUS, |
|
|
|
}, |
|
|
|
}, |
|
|
|
barElement: { |
|
|
|
|
|
|
|
|
|
|
|
[`& .${classes.barElement}`]: { |
|
|
|
padding: 0, |
|
|
|
padding: 0, |
|
|
|
}, |
|
|
|
}, |
|
|
|
iconBox: { |
|
|
|
|
|
|
|
|
|
|
|
[`& .${classes.iconBox}`]: { |
|
|
|
[theme.breakpoints.down('sm')]: { |
|
|
|
[theme.breakpoints.down('sm')]: { |
|
|
|
display: 'none', |
|
|
|
display: 'none', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
searchBar: { |
|
|
|
|
|
|
|
|
|
|
|
[`& .${classes.searchBar}`]: { |
|
|
|
[theme.breakpoints.down('sm')]: { |
|
|
|
[theme.breakpoints.down('sm')]: { |
|
|
|
flexGrow: 1, |
|
|
|
flexGrow: 1, |
|
|
|
paddingLeft: '15vw', |
|
|
|
paddingLeft: '15vw', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
icons: { |
|
|
|
|
|
|
|
|
|
|
|
[`& .${classes.icons}`]: { |
|
|
|
paddingLeft: '.1em', |
|
|
|
paddingLeft: '.1em', |
|
|
|
paddingRight: '.1em', |
|
|
|
paddingRight: '.1em', |
|
|
|
}, |
|
|
|
}, |
|
|
|
})); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
const Header = (): JSX.Element => { |
|
|
|
const Header = (): JSX.Element => { |
|
|
|
const classes = useStyles(); |
|
|
|
|
|
|
|
const [open, setOpen] = useState(false); |
|
|
|
const [open, setOpen] = useState(false); |
|
|
|
|
|
|
|
|
|
|
|
const toggleDrawer = (): void => setOpen(!open); |
|
|
|
const toggleDrawer = (): void => setOpen(!open); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<AppBar position="static" className={classes.appBar}> |
|
|
|
<StyledAppBar> |
|
|
|
<Box display="flex" justifyContent="space-between" flexDirection="row"> |
|
|
|
<Box display="flex" justifyContent="space-between" flexDirection="row"> |
|
|
|
<Box className={classes.barElement}> |
|
|
|
<Box className={classes.barElement}> |
|
|
|
<Button onClick={toggleDrawer}> |
|
|
|
<Button onClick={toggleDrawer}> |
|
|
@ -80,7 +92,7 @@ const Header = (): JSX.Element => { |
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
<AnvilDrawer open={open} setOpen={setOpen} /> |
|
|
|
<AnvilDrawer open={open} setOpen={setOpen} /> |
|
|
|
</AppBar> |
|
|
|
</StyledAppBar> |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|