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