testing public.js changes
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
import { Fragment } from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { List as ImmutableList, fromJS } from 'immutable'
|
||||
import { IntlProvider, addLocaleData } from 'react-intl'
|
||||
import { getLocale } from '../locales'
|
||||
import Video from '../components/video'
|
||||
import StatusCard from '../components/status_card'
|
||||
import Poll from 'gabsocial/components/poll'
|
||||
import MediaGallery from '../components/media_gallery'
|
||||
import ModalRoot from '../components/modal/modal_root'
|
||||
import MediaModal from '../components/modal/media_modal'
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import { IntlProvider, addLocaleData } from 'react-intl';
|
||||
import { getLocale } from '../locales';
|
||||
import MediaGallery from 'gabsocial/components/media_gallery';
|
||||
import Video from 'gabsocial/components/video';
|
||||
import Card from 'gabsocial/components/status_card';
|
||||
import Poll from 'gabsocial/components/poll';
|
||||
import { List as ImmutableList, fromJS } from 'immutable';
|
||||
|
||||
const { localeData, messages } = getLocale();
|
||||
addLocaleData(localeData);
|
||||
|
||||
const MEDIA_COMPONENTS = { MediaGallery, Video, StatusCard, Poll };
|
||||
const MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll };
|
||||
|
||||
export default class MediaContainer extends PureComponent {
|
||||
|
||||
@@ -29,19 +28,19 @@ export default class MediaContainer extends PureComponent {
|
||||
};
|
||||
|
||||
handleOpenMedia = (media, index) => {
|
||||
document.body.classList.add(_s.overflowYHidden);
|
||||
document.body.classList.add('with-modals--active');
|
||||
this.setState({ media, index });
|
||||
}
|
||||
|
||||
handleOpenVideo = (video, time) => {
|
||||
const media = ImmutableList([video]);
|
||||
|
||||
document.body.classList.add(_s.overflowYHidden);
|
||||
document.body.classList.add('with-modals--active');
|
||||
this.setState({ media, time });
|
||||
}
|
||||
|
||||
handleCloseMedia = () => {
|
||||
document.body.classList.remove(_s.overflowYHidden);
|
||||
document.body.classList.remove('with-modals--active');
|
||||
this.setState({ media: null, index: null, time: null });
|
||||
}
|
||||
|
||||
@@ -73,19 +72,9 @@ export default class MediaContainer extends PureComponent {
|
||||
component,
|
||||
);
|
||||
})}
|
||||
<ModalRoot onClose={this.handleCloseMedia}>
|
||||
{this.state.media && (
|
||||
<MediaModal
|
||||
media={this.state.media}
|
||||
index={this.state.index || 0}
|
||||
time={this.state.time}
|
||||
onClose={this.handleCloseMedia}
|
||||
/>
|
||||
)}
|
||||
</ModalRoot>
|
||||
</Fragment>
|
||||
</IntlProvider>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user