about summary refs log blame commit diff
path: root/app/javascript/flavours/glitch/features/ui/components/video_modal.js
blob: 69e0ee46e2a107883eb7c449846521ebd2488d85 (plain) (tree)
1
2
3
4
5
6
7
8
                          
                                                           
                                   
                                                   
                                                                    
 
                                                                
 


                                             
    
             
                                                
            
                                                     
             



                                              
                    
                                          
            



              
 
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')}
            src={media.get('url')}
            startTime={time}
            onCloseVideo={onClose}
            detailed
            alt={media.get('description')}
          />
        </div>
      </div>
    );
  }

}