You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
import PropTypes from 'prop-types'; |
|
import { PureComponent } from 'react'; |
|
|
|
import { FormattedMessage } from 'react-intl'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import CancelPresentationIcon from '@/material-icons/400-24px/cancel_presentation.svg?react'; |
|
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture'; |
|
import { Icon } from 'mastodon/components/icon'; |
|
|
|
class PictureInPicturePlaceholder extends PureComponent { |
|
|
|
static propTypes = { |
|
dispatch: PropTypes.func.isRequired, |
|
aspectRatio: PropTypes.string, |
|
}; |
|
|
|
handleClick = () => { |
|
const { dispatch } = this.props; |
|
dispatch(removePictureInPicture()); |
|
}; |
|
|
|
render () { |
|
const { aspectRatio } = this.props; |
|
|
|
return ( |
|
<div className='picture-in-picture-placeholder' style={{ aspectRatio }} role='button' tabIndex={0} onClick={this.handleClick}> |
|
<Icon id='window-restore' icon={CancelPresentationIcon} /> |
|
<FormattedMessage id='picture_in_picture.restore' defaultMessage='Put it back' /> |
|
</div> |
|
); |
|
} |
|
|
|
} |
|
|
|
export default connect()(PictureInPicturePlaceholder);
|
|
|