import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; import classNames from 'classnames'; import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import { IconButton } from 'mastodon/components/icon_button'; import ImageLoader from './image_loader'; const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, }); class ImageModal extends PureComponent { static propTypes = { src: PropTypes.string.isRequired, alt: PropTypes.string.isRequired, onClose: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, }; state = { navigationHidden: false, }; toggleNavigation = () => { this.setState(prevState => ({ navigationHidden: !prevState.navigationHidden, })); }; render () { const { intl, src, alt, onClose } = this.props; const { navigationHidden } = this.state; const navigationClassName = classNames('media-modal__navigation', { 'media-modal__navigation--hidden': navigationHidden, }); return (