|
|
|
@ -12,6 +12,7 @@ export default class VideoModal extends ImmutablePureComponent {
|
|
|
|
|
static propTypes = {
|
|
|
|
|
media: ImmutablePropTypes.map.isRequired,
|
|
|
|
|
status: ImmutablePropTypes.map,
|
|
|
|
|
account: ImmutablePropTypes.map,
|
|
|
|
|
time: PropTypes.number,
|
|
|
|
|
onClose: PropTypes.func.isRequired,
|
|
|
|
|
};
|
|
|
|
@ -43,16 +44,17 @@ export default class VideoModal extends ImmutablePureComponent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleStatusClick = e => {
|
|
|
|
|
const { status, account } = this.props;
|
|
|
|
|
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/posts/${this.props.status.get('id')}`);
|
|
|
|
|
this.context.router.history.push(`/@${account.get('acct')}/posts/${status.get('id')}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { media, status, time, onClose } = this.props;
|
|
|
|
|
const { media, status, account, time, onClose } = this.props;
|
|
|
|
|
|
|
|
|
|
const link = status && <a href={status.get('url')} onClick={this.handleStatusClick}><FormattedMessage id='lightbox.view_context' defaultMessage='View context' /></a>;
|
|
|
|
|
const link = status && account && <a href={status.get('url')} onClick={this.handleStatusClick}><FormattedMessage id='lightbox.view_context' defaultMessage='View context' /></a>;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className='modal-root__modal video-modal'>
|
|
|
|
|