mastodon/app/javascript/flavours/glitch/features/ui/components/video_modal.js
Eugen Rochko ccf4f3240a [Glitch] Add blurhash
Port front-end changes from fba96c808d to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
2019-05-04 18:07:44 +02:00

36 lines
926 B
JavaScript

import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import Video from 'flavours/glitch/features/video';
import ImmutablePureComponent from 'react-immutable-pure-component';
export default class VideoModal extends ImmutablePureComponent {
static propTypes = {
media: ImmutablePropTypes.map.isRequired,
time: PropTypes.number,
onClose: PropTypes.func.isRequired,
};
render () {
const { media, time, onClose } = this.props;
return (
<div className='modal-root__modal video-modal'>
<div>
<Video
preview={media.get('preview_url')}
blurhash={media.get('blurhash')}
src={media.get('url')}
startTime={time}
onCloseVideo={onClose}
detailed
alt={media.get('description')}
/>
</div>
</div>
);
}
}