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