|
|
@ -1,22 +1,25 @@
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import configureStore from 'flavours/glitch/store/configureStore';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { Helmet } from 'react-helmet';
|
|
|
|
|
|
|
|
import { IntlProvider, addLocaleData } from 'react-intl';
|
|
|
|
|
|
|
|
import { Provider as ReduxProvider } from 'react-redux';
|
|
|
|
import { BrowserRouter, Route } from 'react-router-dom';
|
|
|
|
import { BrowserRouter, Route } from 'react-router-dom';
|
|
|
|
import { ScrollContext } from 'react-router-scroll-4';
|
|
|
|
import { ScrollContext } from 'react-router-scroll-4';
|
|
|
|
|
|
|
|
import configureStore from 'flavours/glitch/store/configureStore';
|
|
|
|
import UI from 'flavours/glitch/features/ui';
|
|
|
|
import UI from 'flavours/glitch/features/ui';
|
|
|
|
import { fetchCustomEmojis } from 'flavours/glitch/actions/custom_emojis';
|
|
|
|
import { fetchCustomEmojis } from 'flavours/glitch/actions/custom_emojis';
|
|
|
|
import { hydrateStore } from 'flavours/glitch/actions/store';
|
|
|
|
import { hydrateStore } from 'flavours/glitch/actions/store';
|
|
|
|
import { connectUserStream } from 'flavours/glitch/actions/streaming';
|
|
|
|
|
|
|
|
import { checkDeprecatedLocalSettings } from 'flavours/glitch/actions/local_settings';
|
|
|
|
import { checkDeprecatedLocalSettings } from 'flavours/glitch/actions/local_settings';
|
|
|
|
import { IntlProvider, addLocaleData } from 'react-intl';
|
|
|
|
import { connectUserStream } from 'flavours/glitch/actions/streaming';
|
|
|
|
import { getLocale } from 'locales';
|
|
|
|
|
|
|
|
import initialState from 'flavours/glitch/initial_state';
|
|
|
|
|
|
|
|
import ErrorBoundary from 'flavours/glitch/components/error_boundary';
|
|
|
|
import ErrorBoundary from 'flavours/glitch/components/error_boundary';
|
|
|
|
|
|
|
|
import initialState, { title as siteTitle } from 'flavours/glitch/initial_state';
|
|
|
|
|
|
|
|
import { getLocale } from 'locales';
|
|
|
|
|
|
|
|
|
|
|
|
const { localeData, messages } = getLocale();
|
|
|
|
const { localeData, messages } = getLocale();
|
|
|
|
addLocaleData(localeData);
|
|
|
|
addLocaleData(localeData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const title = process.env.NODE_ENV === 'production' ? siteTitle : `${siteTitle} (Dev)`;
|
|
|
|
|
|
|
|
|
|
|
|
export const store = configureStore();
|
|
|
|
export const store = configureStore();
|
|
|
|
const hydrateAction = hydrateStore(initialState);
|
|
|
|
const hydrateAction = hydrateStore(initialState);
|
|
|
|
store.dispatch(hydrateAction);
|
|
|
|
store.dispatch(hydrateAction);
|
|
|
@ -78,15 +81,17 @@ export default class Mastodon extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<IntlProvider locale={locale} messages={messages}>
|
|
|
|
<IntlProvider locale={locale} messages={messages}>
|
|
|
|
<Provider store={store}>
|
|
|
|
<ReduxProvider store={store}>
|
|
|
|
<ErrorBoundary>
|
|
|
|
<ErrorBoundary>
|
|
|
|
<BrowserRouter basename='/web'>
|
|
|
|
<BrowserRouter basename='/web'>
|
|
|
|
<ScrollContext shouldUpdateScroll={this.shouldUpdateScroll}>
|
|
|
|
<ScrollContext shouldUpdateScroll={this.shouldUpdateScroll}>
|
|
|
|
<Route path='/' component={UI} />
|
|
|
|
<Route path='/' component={UI} />
|
|
|
|
</ScrollContext>
|
|
|
|
</ScrollContext>
|
|
|
|
</BrowserRouter>
|
|
|
|
</BrowserRouter>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Helmet defaultTitle={title} titleTemplate={`%s - ${title}`} />
|
|
|
|
</ErrorBoundary>
|
|
|
|
</ErrorBoundary>
|
|
|
|
</Provider>
|
|
|
|
</ReduxProvider>
|
|
|
|
</IntlProvider>
|
|
|
|
</IntlProvider>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|