initial commit (frontend)

This commit is contained in:
2026-09-20 15:08:32 +03:00
commit 04cc53e66d
84 changed files with 36264 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
export const getInitData = (): string => {
if (typeof window !== 'undefined' && window.Telegram?.WebApp?.initData) {
return window.Telegram.WebApp.initData;
}
return "";
};
export const getUserId = (): number | null => {
if (typeof window !== 'undefined' && window.Telegram?.WebApp?.initDataUnsafe?.user?.id) {
return window.Telegram.WebApp.initDataUnsafe.user.id;
}
return null;
};
export const getTelegramLang = (): string => {
if (typeof window !== 'undefined' && window.Telegram?.WebApp?.initDataUnsafe?.user?.language_code) {
return window.Telegram.WebApp.initDataUnsafe.user.language_code;
}
return "pl";
};