5f2071d055
Port c8181eb0a4
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
30 lines
879 B
JavaScript
30 lines
879 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Icon } from 'flavours/glitch/components/icon';
|
|
import { removePictureInPicture } from 'flavours/glitch/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());
|
|
};
|
|
|
|
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);
|