選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

50 行
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 './MobileLogo';
  8. import config from 'config';
  9. import { activeItem } from 'store/reducers/menu';
  10. import {useIntl} from "react-intl";
  11. // ==============================|| MAIN LOGO ||============================== //
  12. const LogoSection = ({ sx, to }) => {
  13. const intl = useIntl();
  14. const { defaultId } = useSelector((state) => state.menu);
  15. const dispatch = useDispatch();
  16. return (
  17. <ButtonBase
  18. disableRipple
  19. component={Link}
  20. onClick={() => dispatch(activeItem({ openItem: [defaultId] }))}
  21. to={!to ? config.defaultPath : to}
  22. aria-label={intl.formatMessage({ id: "PNSPS" })}
  23. sx={{
  24. ...sx,
  25. /* WCAG 2.4.7 – visible keyboard focus */
  26. '&:focus-visible': {
  27. outline: '3px solid #0C489E',
  28. outlineOffset: '2px',
  29. borderRadius: '6px'
  30. }
  31. }}
  32. >
  33. <Logo />
  34. </ButtonBase>
  35. );
  36. };
  37. LogoSection.propTypes = {
  38. sx: PropTypes.object,
  39. to: PropTypes.string
  40. };
  41. export default LogoSection;