mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-29 07:16:25 +01:00
36 lines
909 B
JavaScript
36 lines
909 B
JavaScript
import React from 'react';
|
|
import { IntlProvider } from 'react-intl';
|
|
import { Provider } from 'react-redux';
|
|
import { useStore } from 'redux/store';
|
|
import useLocale from 'hooks/useLocale';
|
|
import useForceSSL from 'hooks/useForceSSL';
|
|
import { messages } from 'lib/lang';
|
|
import 'styles/variables.css';
|
|
import 'styles/bootstrap-grid.css';
|
|
import 'styles/index.css';
|
|
|
|
const Intl = ({ children }) => {
|
|
const [locale] = useLocale();
|
|
|
|
const Wrapper = ({ children }) => <span className={locale}>{children}</span>;
|
|
|
|
return (
|
|
<IntlProvider locale={locale} messages={messages[locale]} textComponent={Wrapper}>
|
|
{children}
|
|
</IntlProvider>
|
|
);
|
|
};
|
|
|
|
export default function App({ Component, pageProps }) {
|
|
useForceSSL(process.env.FORCE_SSL);
|
|
const store = useStore();
|
|
|
|
return (
|
|
<Provider store={store}>
|
|
<Intl>
|
|
<Component {...pageProps} />
|
|
</Intl>
|
|
</Provider>
|
|
);
|
|
}
|