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