0
0
Fork 0

Fix /share and cleanup and reorganize frontend locale loading (#25240)

This commit is contained in:
Renaud Chaput 2023-06-02 15:00:27 +02:00 committed by GitHub
parent 5fae2de454
commit b0780cfeed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 152 additions and 638 deletions

View file

@ -1,18 +1,14 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
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';
import { getLocale, onProviderError } from '../locales';
import { IntlProvider } from '../locales';
import { store } from '../store';
const { messages } = getLocale();
if (initialState) {
store.dispatch(hydrateStore(initialState));
@ -20,17 +16,11 @@ if (initialState) {
store.dispatch(fetchCustomEmojis());
export default class TimelineContainer extends PureComponent {
static propTypes = {
locale: PropTypes.string.isRequired,
};
export default class ComposeContainer extends PureComponent {
render () {
const { locale } = this.props;
return (
<IntlProvider locale={locale} messages={messages} onError={onProviderError}>
<IntlProvider>
<Provider store={store}>
<Compose />
</Provider>