Refactored useConfig.
This commit is contained in:
1 parent
cc574e6da4
commit
183dab3ddc
11 files changed
+27
-39
No files matched your search
+1
-14
@@ -6,7 +6,6 @@ import Script from 'next/script';
|
||||
import { useRouter } from 'next/router';
|
||||
import ErrorBoundary from 'components/common/ErrorBoundary';
|
||||
import useLocale from 'components/hooks/useLocale';
|
||||
import useConfig from 'components/hooks/useConfig';
|
||||
import '@fontsource/inter/400.css';
|
||||
import '@fontsource/inter/700.css';
|
||||
import 'react-basics/dist/styles.css';
|
||||
@@ -27,22 +26,10 @@ const client = new QueryClient({
|
||||
export default function App({ Component, pageProps }) {
|
||||
const { locale, messages } = useLocale();
|
||||
const { basePath, pathname } = useRouter();
|
||||
const config = useConfig();
|
||||
|
||||
const Wrapper = ({ children }) => <span className={locale}>{children}</span>;
|
||||
|
||||
if (config?.uiDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={client}>
|
||||
<IntlProvider
|
||||
locale={locale}
|
||||
messages={messages[locale]}
|
||||
textComponent={Wrapper}
|
||||
onError={() => null}
|
||||
>
|
||||
<IntlProvider locale={locale} messages={messages[locale]} onError={() => null}>
|
||||
<ReactBasicsProvider>
|
||||
<ErrorBoundary>
|
||||
<Head>
|
||||
|
||||
Reference in new issue
Block a user