about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/containers/media_gallery_container.js
blob: 54bfbf4535ab7208860b8114d97a4da57315fd7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from 'react';
import PropTypes from 'prop-types';
import { IntlProvider, addLocaleData } from 'react-intl';
import { getLocale } from 'mastodon/locales';
import MediaGallery from 'flavours/glitch/components/media_gallery';
import { fromJS } from 'immutable';

const { localeData, messages } = getLocale();
addLocaleData(localeData);

export default class MediaGalleryContainer extends React.PureComponent {

  static propTypes = {
    locale: PropTypes.string.isRequired,
    media: PropTypes.array.isRequired,
  };

  handleOpenMedia = () => {}

  render () {
    const { locale, media, ...props } = this.props;

    return (
      <IntlProvider locale={locale} messages={messages}>
        <MediaGallery
          {...props}
          media={fromJS(media)}
          onOpenMedia={this.handleOpenMedia}
        />
      </IntlProvider>
    );
  }

}