feat: move html component
This commit is contained in:
parent
142866805c
commit
cd52e4ba8a
|
|
@ -38,7 +38,6 @@ export default async function AppLayout({ children }: { children: ReactNode }) {
|
|||
<body
|
||||
className={clsx(jakartaSans.className, 'dark text-primary !bg-primary')}
|
||||
>
|
||||
<HtmlComponent />
|
||||
<VariableContextComponent
|
||||
storageProvider={
|
||||
process.env.STORAGE_PROVIDER! as 'local' | 'cloudflare'
|
||||
|
|
@ -73,6 +72,7 @@ export default async function AppLayout({ children }: { children: ReactNode }) {
|
|||
}
|
||||
>
|
||||
<SentryComponent>
|
||||
<HtmlComponent />
|
||||
<ToltScript />
|
||||
<FacebookComponent />
|
||||
<Plausible
|
||||
|
|
|
|||
|
|
@ -1,25 +1,16 @@
|
|||
'use client';
|
||||
|
||||
import i18next from './i18next';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { UseTranslationOptions } from 'react-i18next/index';
|
||||
import useCookie from 'react-use-cookie';
|
||||
import {
|
||||
cookieName,
|
||||
fallbackLng,
|
||||
} from '@gitroom/react/translation/i18n.config';
|
||||
import { useVariables } from '@gitroom/react/helpers/variable.context';
|
||||
|
||||
export function useT(ns?: string, options?: UseTranslationOptions<any>) {
|
||||
const { language } = useVariables();
|
||||
const { t } = useTranslation(ns, options);
|
||||
return t;
|
||||
}
|
||||
|
||||
export function useTranslationSettings() {
|
||||
const { language } = useVariables();
|
||||
const [lng] = useCookie(cookieName, language || fallbackLng);
|
||||
const [savedI18next, setSavedI18next] = useState(i18next);
|
||||
|
||||
return savedI18next;
|
||||
|
|
|
|||
Loading…
Reference in New Issue