import { useCallback, useEffect } from 'react'; import classNames from 'classnames'; import { closeModal } from '@/flavours/glitch/actions/modal'; import { useAppDispatch } from '@/flavours/glitch/store'; import { AnnualReport } from '.'; import styles from './index.module.scss'; const AnnualReportModal: React.FC<{ onChangeBackgroundColor: (color: string) => void; }> = ({ onChangeBackgroundColor }) => { useEffect(() => { onChangeBackgroundColor('var(--color-bg-media-base)'); }, [onChangeBackgroundColor]); const dispatch = useAppDispatch(); const handleCloseModal = useCallback>( (e) => { if (e.target === e.currentTarget) dispatch( closeModal({ modalType: 'ANNUAL_REPORT', ignoreFocus: false }), ); }, [dispatch], ); return ( // It's fine not to provide a keyboard handler here since there is a global // [Esc] key listener that will close open modals. // This onClick handler is needed since the modalWrapper styles overlap the // default modal backdrop, preventing clicks to pass through. // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
); }; // eslint-disable-next-line import/no-default-export export default AnnualReportModal;