one-api/web/berry/src/layout/MainLayout/LogoSection/index.js
2024-01-02 16:04:59 +08:00

24 lines
676 B
JavaScript

import { Link } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
// material-ui
import { ButtonBase } from '@mui/material';
// project imports
import Logo from 'ui-component/Logo';
import { MENU_OPEN } from 'store/actions';
// ==============================|| MAIN LOGO ||============================== //
const LogoSection = () => {
const defaultId = useSelector((state) => state.customization.defaultId);
const dispatch = useDispatch();
return (
<ButtonBase disableRipple onClick={() => dispatch({ type: MENU_OPEN, id: defaultId })} component={Link} to="/">
<Logo />
</ButtonBase>
);
};
export default LogoSection;