2020-09-06 02:27:01 +02:00
|
|
|
import { IntlProvider } from 'react-intl';
|
2022-12-13 04:45:38 +01:00
|
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
2023-01-10 08:59:26 +01:00
|
|
|
import Head from 'next/head';
|
2023-04-03 08:12:43 +02:00
|
|
|
import Script from 'next/script';
|
2023-01-10 08:59:26 +01:00
|
|
|
import { useRouter } from 'next/router';
|
2020-09-09 05:46:31 +02:00
|
|
|
import useLocale from 'hooks/useLocale';
|
2022-10-31 19:02:37 +01:00
|
|
|
import useConfig from 'hooks/useConfig';
|
2023-04-03 08:12:43 +02:00
|
|
|
import '@fontsource/inter/400.css';
|
|
|
|
import '@fontsource/inter/700.css';
|
2022-12-13 04:45:38 +01:00
|
|
|
import 'react-basics/dist/styles.css';
|
2020-08-06 04:04:02 +02:00
|
|
|
import 'styles/variables.css';
|
2023-01-10 08:59:26 +01:00
|
|
|
import 'styles/locale.css';
|
2020-08-02 06:20:52 +02:00
|
|
|
import 'styles/index.css';
|
2023-03-15 06:37:50 +01:00
|
|
|
import 'chartjs-adapter-date-fns';
|
2023-04-02 05:03:38 +02:00
|
|
|
|
2023-01-11 02:18:59 +01:00
|
|
|
const client = new QueryClient({
|
|
|
|
defaultOptions: {
|
|
|
|
queries: {
|
2023-02-18 06:42:42 +01:00
|
|
|
retry: false,
|
2023-01-11 02:18:59 +01:00
|
|
|
refetchOnWindowFocus: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
2022-12-13 04:45:38 +01:00
|
|
|
|
2020-07-17 10:03:38 +02:00
|
|
|
export default function App({ Component, pageProps }) {
|
2022-10-31 19:02:37 +01:00
|
|
|
const { locale, messages } = useLocale();
|
2023-03-04 06:26:39 +01:00
|
|
|
const { basePath, pathname } = useRouter();
|
2023-03-09 01:37:43 +01:00
|
|
|
const config = useConfig();
|
2022-10-31 19:02:37 +01:00
|
|
|
|
|
|
|
const Wrapper = ({ children }) => <span className={locale}>{children}</span>;
|
2022-10-28 01:42:57 +02:00
|
|
|
|
2023-03-22 05:28:36 +01:00
|
|
|
if (config?.uiDisabled) {
|
2022-10-28 01:42:57 +02:00
|
|
|
return null;
|
|
|
|
}
|
2020-08-05 07:45:05 +02:00
|
|
|
|
|
|
|
return (
|
2022-12-13 04:45:38 +01:00
|
|
|
<QueryClientProvider client={client}>
|
2023-01-11 17:33:43 +01:00
|
|
|
<IntlProvider
|
|
|
|
locale={locale}
|
|
|
|
messages={messages[locale]}
|
|
|
|
textComponent={Wrapper}
|
|
|
|
onError={() => null}
|
|
|
|
>
|
2023-01-10 08:59:26 +01:00
|
|
|
<Head>
|
|
|
|
<link rel="icon" href={`${basePath}/favicon.ico`} />
|
|
|
|
<link rel="apple-touch-icon" sizes="180x180" href={`${basePath}/apple-touch-icon.png`} />
|
|
|
|
<link rel="icon" type="image/png" sizes="32x32" href={`${basePath}/favicon-32x32.png`} />
|
|
|
|
<link rel="icon" type="image/png" sizes="16x16" href={`${basePath}/favicon-16x16.png`} />
|
|
|
|
<link rel="manifest" href={`${basePath}/site.webmanifest`} />
|
|
|
|
<link rel="mask-icon" href={`${basePath}/safari-pinned-tab.svg`} color="#5bbad5" />
|
|
|
|
<meta name="msapplication-TileColor" content="#da532c" />
|
|
|
|
<meta name="theme-color" content="#fafafa" media="(prefers-color-scheme: light)" />
|
|
|
|
<meta name="theme-color" content="#2f2f2f" media="(prefers-color-scheme: dark)" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
2023-04-18 14:05:43 +02:00
|
|
|
<meta name="robots" content="noindex,nofollow" />
|
2023-01-10 08:59:26 +01:00
|
|
|
</Head>
|
2023-04-02 19:00:28 +02:00
|
|
|
<Component {...pageProps} />
|
2023-03-04 06:26:39 +01:00
|
|
|
{!pathname.includes('/share/') && <Script src={`${basePath}/telemetry.js`} />}
|
2022-12-13 04:45:38 +01:00
|
|
|
</IntlProvider>
|
|
|
|
</QueryClientProvider>
|
2020-08-05 07:45:05 +02:00
|
|
|
);
|
2020-07-17 10:03:38 +02:00
|
|
|
}
|