// Package imports. import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, injectIntl } from 'react-intl'; // Mastodon imports. import IconButton from './icon_button'; import VisibilityIcon from './status_visibility_icon'; // Messages for use with internationalization stuff. const messages = defineMessages({ collapse: { id: 'status.collapse', defaultMessage: 'Collapse' }, uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' }, }); export default @injectIntl class StatusIcons extends React.PureComponent { static propTypes = { status: ImmutablePropTypes.map.isRequired, mediaIcon: PropTypes.string, collapsible: PropTypes.bool, collapsed: PropTypes.bool, directMessage: PropTypes.bool, setCollapsed: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, }; // Handles clicks on collapsed button handleCollapsedClick = (e) => { const { collapsed, setCollapsed } = this.props; if (e.button === 0) { setCollapsed(!collapsed); e.preventDefault(); } } // Rendering. render () { const { status, mediaIcon, collapsible, collapsed, directMessage, intl, } = this.props; return (