mirror of
https://github.com/whippyshou/mastodon
synced 2024-11-29 15:28:27 +09:00
f5bf5ebb82
* Replace browserify with webpack * Add react-intl-translations-manager * Do not minify in development, add offline-plugin for ServiceWorker background cache updates * Adjust tests and dependencies * Fix production deployments * Fix tests * More optimizations * Improve travis cache for npm stuff * Re-run travis * Add back support for custom.scss as before * Remove offline-plugin and babili * Fix issue with Immutable.List().unshift(...values) not working as expected * Make travis load schema instead of running all migrations in sequence * Fix missing React import in WarningContainer. Optimize rendering performance by using ImmutablePureComponent instead of React.PureComponent. ImmutablePureComponent uses Immutable.is() to compare props. Replace dynamic callback bindings in <UI /> * Add react definitions to places that use JSX * Add Procfile.dev for running rails, webpack and streaming API at the same time
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
import React from 'react';
|
|
import LoadingIndicator from '../../../components/loading_indicator';
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
import PropTypes from 'prop-types';
|
|
import ExtendedVideoPlayer from '../../../components/extended_video_player';
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
import IconButton from '../../../components/icon_button';
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
const messages = defineMessages({
|
|
close: { id: 'lightbox.close', defaultMessage: 'Close' }
|
|
});
|
|
|
|
class VideoModal extends ImmutablePureComponent {
|
|
|
|
render () {
|
|
const { media, intl, time, onClose } = this.props;
|
|
|
|
const url = media.get('url');
|
|
|
|
return (
|
|
<div className='modal-root__modal media-modal'>
|
|
<div>
|
|
<div className='media-modal__close'><IconButton title={intl.formatMessage(messages.close)} icon='times' overlay onClick={onClose} /></div>
|
|
<ExtendedVideoPlayer src={url} muted={false} controls={true} time={time} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
VideoModal.propTypes = {
|
|
media: ImmutablePropTypes.map.isRequired,
|
|
time: PropTypes.number,
|
|
onClose: PropTypes.func.isRequired,
|
|
intl: PropTypes.object.isRequired
|
|
};
|
|
|
|
export default injectIntl(VideoModal);
|