chinwagsocial/app/javascript/mastodon/components/picture_in_picture_placeholder.jsx

31 lines
872 B
React
Raw Normal View History

2023-05-23 18:52:27 +10:00
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Icon } from 'mastodon/components/icon';
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
import { connect } from 'react-redux';
import { FormattedMessage } from 'react-intl';
2023-05-23 18:52:27 +10:00
class PictureInPicturePlaceholder extends PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,
};
handleClick = () => {
const { dispatch } = this.props;
dispatch(removePictureInPicture());
2023-01-30 11:45:35 +11:00
};
render () {
return (
<div className='picture-in-picture-placeholder' role='button' tabIndex={0} onClick={this.handleClick}>
<Icon id='window-restore' />
<FormattedMessage id='picture_in_picture.restore' defaultMessage='Put it back' />
</div>
);
}
}
export default connect()(PictureInPicturePlaceholder);