[Glitch] Upgrade react-intl
Port 44cd88adc4 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
|
||||
import { IntlProvider, addLocaleData } from 'react-intl';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
|
||||
import { getLocale } from 'mastodon/locales';
|
||||
import { getLocale, onProviderError } from 'mastodon/locales';
|
||||
|
||||
const { localeData, messages } = getLocale();
|
||||
addLocaleData(localeData);
|
||||
const { messages } = getLocale();
|
||||
|
||||
export default class AdminComponent extends PureComponent {
|
||||
|
||||
@@ -19,7 +18,7 @@ export default class AdminComponent extends PureComponent {
|
||||
const { locale, children } = this.props;
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale} messages={messages}>
|
||||
<IntlProvider locale={locale} messages={messages} onError={onProviderError}>
|
||||
{children}
|
||||
</IntlProvider>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
|
||||
import { IntlProvider, addLocaleData } from 'react-intl';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
@@ -11,10 +11,9 @@ import Compose from 'flavours/glitch/features/standalone/compose';
|
||||
import initialState from 'flavours/glitch/initial_state';
|
||||
import { store } from 'flavours/glitch/store';
|
||||
|
||||
import { getLocale } from 'mastodon/locales';
|
||||
import { getLocale, onProviderError } from 'mastodon/locales';
|
||||
|
||||
const { localeData, messages } = getLocale();
|
||||
addLocaleData(localeData);
|
||||
const { messages } = getLocale();
|
||||
|
||||
if (initialState) {
|
||||
store.dispatch(hydrateStore(initialState));
|
||||
@@ -32,7 +31,7 @@ export default class TimelineContainer extends PureComponent {
|
||||
const { locale } = this.props;
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale} messages={messages}>
|
||||
<IntlProvider locale={locale} messages={messages} onError={onProviderError}>
|
||||
<Provider store={store}>
|
||||
<Compose />
|
||||
</Provider>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
|
||||
import { IntlProvider, addLocaleData } from 'react-intl';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { BrowserRouter, Route } from 'react-router-dom';
|
||||
@@ -18,10 +18,9 @@ import ErrorBoundary from 'flavours/glitch/components/error_boundary';
|
||||
import UI from 'flavours/glitch/features/ui';
|
||||
import initialState, { title as siteTitle } from 'flavours/glitch/initial_state';
|
||||
import { store } from 'flavours/glitch/store';
|
||||
import { getLocale } from 'locales';
|
||||
import { getLocale, onProviderError } from 'locales';
|
||||
|
||||
const { localeData, messages } = getLocale();
|
||||
addLocaleData(localeData);
|
||||
const { messages } = getLocale();
|
||||
|
||||
const title = process.env.NODE_ENV === 'production' ? siteTitle : `${siteTitle} (Dev)`;
|
||||
|
||||
@@ -87,7 +86,7 @@ export default class Mastodon extends PureComponent {
|
||||
const { locale } = this.props;
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale} messages={messages}>
|
||||
<IntlProvider locale={locale} messages={messages} onError={onProviderError}>
|
||||
<ReduxProvider store={store}>
|
||||
<ErrorBoundary>
|
||||
<BrowserRouter>
|
||||
|
||||
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
|
||||
import { IntlProvider, addLocaleData } from 'react-intl';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
@@ -16,10 +16,9 @@ import MediaModal from 'flavours/glitch/features/ui/components/media_modal';
|
||||
import Video from 'flavours/glitch/features/video';
|
||||
import { getScrollbarWidth } from 'flavours/glitch/utils/scrollbar';
|
||||
|
||||
import { getLocale } from 'mastodon/locales';
|
||||
import { getLocale, onProviderError } from 'mastodon/locales';
|
||||
|
||||
const { localeData, messages } = getLocale();
|
||||
addLocaleData(localeData);
|
||||
const { messages } = getLocale();
|
||||
|
||||
const MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll, Hashtag, Audio };
|
||||
|
||||
@@ -85,7 +84,7 @@ export default class MediaContainer extends PureComponent {
|
||||
}
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale} messages={messages}>
|
||||
<IntlProvider locale={locale} messages={messages} onError={onProviderError}>
|
||||
<>
|
||||
{[].map.call(components, (component, i) => {
|
||||
const componentName = component.getAttribute('data-component');
|
||||
|
||||
Reference in New Issue
Block a user