1
0
mirror of https://github.com/kremalicious/umami.git synced 2024-12-23 01:30:05 +01:00
umami/pages/_app.js
2020-10-03 21:54:21 -07:00

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>
);
}