chuckya/app/javascript/mastodon/containers/compose_container.jsx

42 lines
996 B
React
Raw Normal View History

import PropTypes from 'prop-types';
2023-05-23 17:52:27 +09:00
import { PureComponent } from 'react';
2023-06-01 06:43:39 +09:00
import { IntlProvider } 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';
2023-06-01 06:43:39 +09:00
import { getLocale, onProviderError } from '../locales';
import { store } from '../store';
2023-06-01 06:43:39 +09:00
const { messages } = getLocale();
if (initialState) {
store.dispatch(hydrateStore(initialState));
}
store.dispatch(fetchCustomEmojis());
2023-05-23 17:52:27 +09:00
export default class TimelineContainer extends PureComponent {
static propTypes = {
locale: PropTypes.string.isRequired,
};
render () {
const { locale } = this.props;
return (
2023-06-01 06:43:39 +09:00
<IntlProvider locale={locale} messages={messages} onError={onProviderError}>
<Provider store={store}>
<Compose />
</Provider>
</IntlProvider>
);
}
}