diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-15 12:24:42 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-15 17:26:16 +0100 |
| commit | 0f38aee374029213a47ef7c29bd164093fe63c85 (patch) | |
| tree | 290cb6471fdfe81e4c42f4da4729247536b04ee7 /src/pages/_app.tsx | |
| parent | be4d907efb4e2fa658baa7c9b276ed282eb920db (diff) | |
refactor(hooks): remove useSettings hook
It does not make sense to re-export an existing object through a hook.
On some pages both the hook and the object was imported...
It is better to use the CONFIG (previously settings) object directly
and by doing it we avoid potential errors because of conditional hooks.
Diffstat (limited to 'src/pages/_app.tsx')
| -rw-r--r-- | src/pages/_app.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index caf4a96..525335f 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -2,7 +2,7 @@ import { useRouter } from 'next/router'; import { IntlProvider } from 'react-intl'; import '../styles/globals.scss'; import type { AppPropsWithLayout } from '../types'; -import { settings } from '../utils/config'; +import { CONFIG } from '../utils/config'; import { PRISM_THEME_ATTRIBUTE, STORAGE_KEY } from '../utils/constants'; import { AckeeProvider, @@ -13,14 +13,14 @@ import { const App = ({ Component, pageProps }: AppPropsWithLayout) => { const { locale, defaultLocale } = useRouter(); - const appLocale: string = locale ?? settings.locales.defaultLocale; + const appLocale: string = locale ?? CONFIG.locales.defaultLocale; const getLayout = Component.getLayout ?? ((page) => page); const { translation, ...componentProps } = pageProps; return ( <AckeeProvider - domainId={settings.ackee.siteId} - server={settings.ackee.url} + domainId={CONFIG.ackee.siteId} + server={CONFIG.ackee.url} storageKey={STORAGE_KEY.ACKEE} tracking="full" > |
