2020-09-06 00:27:01 +00:00
|
|
|
import { IntlProvider } from 'react-intl';
|
2022-11-22 06:32:55 +00:00
|
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
2020-09-09 03:46:31 +00:00
|
|
|
import useLocale from 'hooks/useLocale';
|
2022-10-31 18:02:37 +00:00
|
|
|
import useConfig from 'hooks/useConfig';
|
2022-11-22 06:32:55 +00:00
|
|
|
import 'react-basics/dist/styles.css';
|
2022-12-09 07:43:43 +00:00
|
|
|
import 'styles/variables.css';
|
2020-08-02 04:20:52 +00:00
|
|
|
import 'styles/index.css';
|
2021-05-20 20:21:30 +00:00
|
|
|
import '@fontsource/inter/400.css';
|
|
|
|
|
import '@fontsource/inter/600.css';
|
2020-09-07 08:22:16 +00:00
|
|
|
|
2022-11-22 06:32:55 +00:00
|
|
|
const client = new QueryClient();
|
|
|
|
|
|
2020-07-17 08:03:38 +00:00
|
|
|
export default function App({ Component, pageProps }) {
|
2022-12-09 07:43:43 +00:00
|
|
|
const { locale, messages } = useLocale();
|
2022-10-31 18:02:37 +00:00
|
|
|
useConfig();
|
|
|
|
|
|
|
|
|
|
const Wrapper = ({ children }) => <span className={locale}>{children}</span>;
|
2022-10-27 23:42:57 +00:00
|
|
|
|
2022-10-28 17:34:50 +00:00
|
|
|
if (process.env.uiDisabled) {
|
2022-10-27 23:42:57 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
2020-08-05 05:45:05 +00:00
|
|
|
|
|
|
|
|
return (
|
2022-11-22 06:32:55 +00:00
|
|
|
<QueryClientProvider client={client}>
|
|
|
|
|
<IntlProvider locale={locale} messages={messages[locale]} textComponent={Wrapper}>
|
2022-12-09 07:43:43 +00:00
|
|
|
<Component {...pageProps} />
|
2022-11-22 06:32:55 +00:00
|
|
|
</IntlProvider>
|
|
|
|
|
</QueryClientProvider>
|
2020-08-05 05:45:05 +00:00
|
|
|
);
|
2020-07-17 08:03:38 +00:00
|
|
|
}
|