diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-10-31 18:25:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-31 18:25:34 +0100 |
commit | 968f34300681d8082cf2f824722a3945fc604b2d (patch) | |
tree | 910675cc3b8d9022f65bcfa9bee1acee6af8d0e4 /app/javascript/flavours/glitch/containers/mastodon.js | |
parent | 371563b0e249b6369e04709fb974a8e57413529f (diff) | |
parent | 1fe4e5e38c17a726e6aea5d6033139653e89a379 (diff) |
Merge pull request #1876 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/containers/mastodon.js')
-rw-r--r-- | app/javascript/flavours/glitch/containers/mastodon.js | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/app/javascript/flavours/glitch/containers/mastodon.js b/app/javascript/flavours/glitch/containers/mastodon.js index bc0311293..cf870102b 100644 --- a/app/javascript/flavours/glitch/containers/mastodon.js +++ b/app/javascript/flavours/glitch/containers/mastodon.js @@ -1,22 +1,25 @@ -import React from 'react'; -import { Provider } from 'react-redux'; 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 { ScrollContext } from 'react-router-scroll-4'; +import configureStore from 'flavours/glitch/store/configureStore'; import UI from 'flavours/glitch/features/ui'; import { fetchCustomEmojis } from 'flavours/glitch/actions/custom_emojis'; import { hydrateStore } from 'flavours/glitch/actions/store'; -import { connectUserStream } from 'flavours/glitch/actions/streaming'; import { checkDeprecatedLocalSettings } from 'flavours/glitch/actions/local_settings'; -import { IntlProvider, addLocaleData } from 'react-intl'; -import { getLocale } from 'locales'; -import initialState from 'flavours/glitch/initial_state'; +import { connectUserStream } from 'flavours/glitch/actions/streaming'; 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(); addLocaleData(localeData); +const title = process.env.NODE_ENV === 'production' ? siteTitle : `${siteTitle} (Dev)`; + export const store = configureStore(); const hydrateAction = hydrateStore(initialState); store.dispatch(hydrateAction); @@ -78,15 +81,17 @@ export default class Mastodon extends React.PureComponent { return ( <IntlProvider locale={locale} messages={messages}> - <Provider store={store}> + <ReduxProvider store={store}> <ErrorBoundary> - <BrowserRouter basename='/web'> + <BrowserRouter> <ScrollContext shouldUpdateScroll={this.shouldUpdateScroll}> <Route path='/' component={UI} /> </ScrollContext> </BrowserRouter> + + <Helmet defaultTitle={title} titleTemplate={`%s - ${title}`} /> </ErrorBoundary> - </Provider> + </ReduxProvider> </IntlProvider> ); } |