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.
 
 

46 lines
1.2 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. import {
  12. checkSysEnv
  13. } from "utils/Utils";
  14. // ==============================|| MAIN LOGO ||============================== //
  15. const LogoSection = ({ sx, to }) => {
  16. const { defaultId } = useSelector((state) => state.menu);
  17. const dispatch = useDispatch();
  18. return (
  19. <Stack direction="column" justifyContent="center" alignItems="center" >
  20. <ButtonBase
  21. disableRipple
  22. component={Link}
  23. onClick={() => dispatch(activeItem({ openItem: [defaultId] }))}
  24. to={!to ? config.defaultPath : to}
  25. sx={sx}
  26. >
  27. <Logo />
  28. </ButtonBase>
  29. <span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="systemTitle">PNSPS</span>
  30. </Stack>
  31. );
  32. };
  33. LogoSection.propTypes = {
  34. sx: PropTypes.object,
  35. to: PropTypes.string
  36. };
  37. export default LogoSection;