mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-22 01:03:39 +01:00
34 lines
826 B
JavaScript
34 lines
826 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 { 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 }) {
|
|
const store = useStore();
|
|
|
|
return (
|
|
<Provider store={store}>
|
|
<Intl>
|
|
<Component {...pageProps} />
|
|
</Intl>
|
|
</Provider>
|
|
);
|
|
}
|