59 lines
1.6 KiB
JavaScript
59 lines
1.6 KiB
JavaScript
import PropTypes from 'prop-types';
|
|
|
|
// material-ui
|
|
import { useTheme } from '@mui/material/styles';
|
|
import { useMediaQuery } from '@mui/material';
|
|
|
|
// project import
|
|
import DrawerHeaderStyled from './DrawerHeaderStyled';
|
|
|
|
import { MenuOrientation } from 'config';
|
|
import useConfig from 'hooks/useConfig';
|
|
|
|
import logo from 'assets/images/logo-nearle9.png'
|
|
import logo1 from 'assets/images/logo-sm1.png'
|
|
// ==============================|| DRAWER HEADER ||============================== //
|
|
|
|
const DrawerHeader = ({ open }) => {
|
|
const theme = useTheme();
|
|
const downLG = useMediaQuery(theme.breakpoints.down('lg'));
|
|
|
|
const { menuOrientation } = useConfig();
|
|
const isHorizontal = menuOrientation === MenuOrientation.HORIZONTAL && !downLG;
|
|
|
|
return (
|
|
<DrawerHeaderStyled
|
|
theme={theme}
|
|
open={open}
|
|
sx={{
|
|
minHeight: isHorizontal ? 'unset' : '60px',
|
|
width: isHorizontal ? { xs: '100%', lg: '424px' } : 'inherit',
|
|
paddingTop: isHorizontal ? { xs: '10px', lg: '0' } : '8px',
|
|
paddingBottom: isHorizontal ? { xs: '18px', lg: '0' } : '8px',
|
|
paddingLeft: isHorizontal ? { xs: '24px', lg: '0' } : open ? '24px' : 0
|
|
}}
|
|
>
|
|
{/* <Logo isIcon={!open} sx={{ width: open ? 'auto' : 35, height: 35 }} /> */}
|
|
|
|
{(open) &&
|
|
<img src={logo}
|
|
// width='160px'
|
|
// height='45px'
|
|
// width='170px'
|
|
alt='logo'/>
|
|
}
|
|
{(!open) &&
|
|
<img src={logo1}
|
|
width='40px'
|
|
alt='logo'/>
|
|
}
|
|
</DrawerHeaderStyled>
|
|
);
|
|
};
|
|
|
|
DrawerHeader.propTypes = {
|
|
open: PropTypes.bool
|
|
};
|
|
|
|
export default DrawerHeader;
|