fix build
This commit is contained in:
parent
b5813e3b53
commit
7560b1702f
@ -2,10 +2,8 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useBackButton, useClientOnce, useDidMount, useViewport } from '@/hooks/telegram';
|
import { useBackButton, useClientOnce, useDidMount, useViewport } from '@/hooks/telegram';
|
||||||
import { setLocale } from '@/utils/i18n/locale';
|
|
||||||
import { init } from '@/utils/telegram/init';
|
import { init } from '@/utils/telegram/init';
|
||||||
import { initData, useSignal } from '@telegram-apps/sdk-react';
|
import { type PropsWithChildren } from 'react';
|
||||||
import { type PropsWithChildren, useEffect } from 'react';
|
|
||||||
|
|
||||||
export function TelegramProvider(props: Readonly<PropsWithChildren>) {
|
export function TelegramProvider(props: Readonly<PropsWithChildren>) {
|
||||||
// Unfortunately, Telegram Mini Apps does not allow us to use all features of
|
// Unfortunately, Telegram Mini Apps does not allow us to use all features of
|
||||||
@ -31,12 +29,5 @@ function RootInner({ children }: PropsWithChildren) {
|
|||||||
useViewport();
|
useViewport();
|
||||||
useBackButton();
|
useBackButton();
|
||||||
|
|
||||||
const initDataUser = useSignal(initData.user);
|
|
||||||
|
|
||||||
// Set the user locale.
|
|
||||||
useEffect(() => {
|
|
||||||
if (initDataUser) setLocale(initDataUser.languageCode);
|
|
||||||
}, [initDataUser]);
|
|
||||||
|
|
||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"i18n": {
|
|
||||||
"header": "Application supports i18n",
|
|
||||||
"footer": "You can select a different language from the dropdown menu."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"i18n": {
|
|
||||||
"header": "Поддержка i18n",
|
|
||||||
"footer": "Вы можете выбрать другой язык в выпадающем меню."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user