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.

58 lines
1.5 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. import {useIntl} from "react-intl";
  15. // ==============================|| MAIN LOGO ||============================== //
  16. const LogoSection = ({ sx, to }) => {
  17. const { defaultId } = useSelector((state) => state.menu);
  18. const dispatch = useDispatch();
  19. const intl = useIntl();
  20. return (
  21. <ButtonBase
  22. disableRipple
  23. component={Link}
  24. onClick={() => dispatch(activeItem({ openItem: [defaultId] }))}
  25. to={!to ? config.defaultPath : to}
  26. aria-label={intl.formatMessage({ id: "PNSPS", defaultMessage: "PNSPS" })}
  27. sx={{
  28. ...sx,
  29. /* ✅ WCAG 2.4.7 focus indicator */
  30. '&:focus-visible': {
  31. outline: '3px solid #0C489E',
  32. outlineOffset: '2px',
  33. borderRadius: '6px'
  34. }
  35. }}
  36. >
  37. <Stack direction="column" justifyContent="center" alignItems="center" >
  38. <Logo />
  39. <span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="systemTitle">PNSPS</span>
  40. </Stack>
  41. </ButtonBase>
  42. );
  43. };
  44. LogoSection.propTypes = {
  45. sx: PropTypes.object,
  46. to: PropTypes.string
  47. };
  48. export default LogoSection;