2020-09-28 20:29:43 +09:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-28 23:38:10 +09:00
|
|
|
import { PureComponent } from 'react';
|
|
|
|
|
2020-09-28 20:29:43 +09:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
2023-05-28 23:38:10 +09:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
2023-10-25 02:45:08 +09:00
|
|
|
|
2024-01-16 19:27:26 +09:00
|
|
|
import CancelPresentationIcon from '@/material-icons/400-24px/cancel_presentation.svg?react';
|
2023-05-28 23:38:10 +09:00
|
|
|
import { removePictureInPicture } from 'flavours/glitch/actions/picture_in_picture';
|
2023-11-16 06:44:47 +09:00
|
|
|
import { Icon } from 'flavours/glitch/components/icon';
|
2023-05-28 23:38:10 +09:00
|
|
|
|
2023-05-28 21:18:23 +09:00
|
|
|
class PictureInPicturePlaceholder extends PureComponent {
|
2020-09-28 20:29:43 +09:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
dispatch: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
handleClick = () => {
|
|
|
|
const { dispatch } = this.props;
|
|
|
|
dispatch(removePictureInPicture());
|
2023-02-04 04:52:07 +09:00
|
|
|
};
|
2020-09-28 20:29:43 +09:00
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
2023-05-02 20:58:48 +09:00
|
|
|
<div className='picture-in-picture-placeholder' role='button' tabIndex={0} onClick={this.handleClick}>
|
2023-10-25 02:45:08 +09:00
|
|
|
<Icon id='window-restore' icon={CancelPresentationIcon} />
|
2020-09-28 20:29:43 +09:00
|
|
|
<FormattedMessage id='picture_in_picture.restore' defaultMessage='Put it back' />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-25 07:15:25 +09:00
|
|
|
|
|
|
|
export default connect()(PictureInPicturePlaceholder);
|