You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 line
1.1 KiB

  1. import PropTypes from 'prop-types';
  2. import { Link } from 'react-router-dom';
  3. // material-ui
  4. import { ButtonBase } from '@mui/material';
  5. import { useDispatch, useSelector } from 'react-redux';
  6. // project import
  7. import Logo from './AdminLogo';
  8. import config from 'config';
  9. import { activeItem } from 'store/reducers/menu';
  10. import { Stack } from '@mui/material';
  11. // ==============================|| MAIN LOGO ||============================== //
  12. const LogoSection = ({ sx, to }) => {
  13. const { defaultId } = useSelector((state) => state.menu);
  14. const dispatch = useDispatch();
  15. return (
  16. <Stack direction="column" justifyContent="center" alignItems="center" >
  17. <ButtonBase
  18. disableRipple
  19. component={Link}
  20. onClick={() => dispatch(activeItem({ openItem: [defaultId] }))}
  21. to={!to ? config.defaultPath : to}
  22. sx={sx}
  23. >
  24. <Logo />
  25. </ButtonBase>
  26. <span id="systemTitle" >PNSPS</span>
  27. </Stack>
  28. );
  29. };
  30. LogoSection.propTypes = {
  31. sx: PropTypes.object,
  32. to: PropTypes.string
  33. };
  34. export default LogoSection;