mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-27 11:53:42 +08:00
* feat: add theme berry * docs: add development notes * fix: fix blank page * chore: update implementation * fix: fix package.json * chore: update ui copy --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
69 lines
1.8 KiB
JavaScript
69 lines
1.8 KiB
JavaScript
import PropTypes from 'prop-types';
|
|
|
|
// material-ui
|
|
import { useTheme } from '@mui/material/styles';
|
|
import { Avatar, Box, ButtonBase } from '@mui/material';
|
|
|
|
// project imports
|
|
import LogoSection from '../LogoSection';
|
|
import ProfileSection from './ProfileSection';
|
|
|
|
// assets
|
|
import { IconMenu2 } from '@tabler/icons-react';
|
|
|
|
// ==============================|| MAIN NAVBAR / HEADER ||============================== //
|
|
|
|
const Header = ({ handleLeftDrawerToggle }) => {
|
|
const theme = useTheme();
|
|
|
|
return (
|
|
<>
|
|
{/* logo & toggler button */}
|
|
<Box
|
|
sx={{
|
|
width: 228,
|
|
display: 'flex',
|
|
[theme.breakpoints.down('md')]: {
|
|
width: 'auto'
|
|
}
|
|
}}
|
|
>
|
|
<Box component="span" sx={{ display: { xs: 'none', md: 'block' }, flexGrow: 1 }}>
|
|
<LogoSection />
|
|
</Box>
|
|
<ButtonBase sx={{ borderRadius: '12px', overflow: 'hidden' }}>
|
|
<Avatar
|
|
variant="rounded"
|
|
sx={{
|
|
...theme.typography.commonAvatar,
|
|
...theme.typography.mediumAvatar,
|
|
transition: 'all .2s ease-in-out',
|
|
background: theme.palette.secondary.light,
|
|
color: theme.palette.secondary.dark,
|
|
'&:hover': {
|
|
background: theme.palette.secondary.dark,
|
|
color: theme.palette.secondary.light
|
|
}
|
|
}}
|
|
onClick={handleLeftDrawerToggle}
|
|
color="inherit"
|
|
>
|
|
<IconMenu2 stroke={1.5} size="1.3rem" />
|
|
</Avatar>
|
|
</ButtonBase>
|
|
</Box>
|
|
|
|
<Box sx={{ flexGrow: 1 }} />
|
|
<Box sx={{ flexGrow: 1 }} />
|
|
|
|
<ProfileSection />
|
|
</>
|
|
);
|
|
};
|
|
|
|
Header.propTypes = {
|
|
handleLeftDrawerToggle: PropTypes.func
|
|
};
|
|
|
|
export default Header;
|