~cytrogen/masto-fe

ref: d907e7914094cfbbd54c2662ff09a6113ed526e9 masto-fe/app/javascript/mastodon/containers/compose_container.jsx -rw-r--r-- 1007 bytes
d907e791 — Claire Merge pull request #2242 from ClearlyClaire/glitch-soc/merge-upstream 2 years ago
                                                                                
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
35
36
37
38
39
40
41
42
import PropTypes from 'prop-types';
import { PureComponent } from 'react';

import { IntlProvider, addLocaleData } from 'react-intl';

import { Provider } from 'react-redux';

import { fetchCustomEmojis } from '../actions/custom_emojis';
import { hydrateStore } from '../actions/store';
import Compose from '../features/standalone/compose';
import initialState from '../initial_state';
import { getLocale } from '../locales';
import { store } from '../store';

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

if (initialState) {
  store.dispatch(hydrateStore(initialState));
}

store.dispatch(fetchCustomEmojis());

export default class TimelineContainer extends PureComponent {

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

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

    return (
      <IntlProvider locale={locale} messages={messages}>
        <Provider store={store}>
          <Compose />
        </Provider>
      </IntlProvider>
    );
  }

}