From 97ebb3318964b2e59c8969bedefcc44b5e95ee4f Mon Sep 17 00:00:00 2001 From: Egor Date: Wed, 21 Jan 2026 05:31:18 +0300 Subject: [PATCH 1/3] Update Layout.tsx --- src/components/layout/Layout.tsx | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index fbfdd1f..d191908 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -13,6 +13,7 @@ import { brandingApi, getCachedBranding, setCachedBranding, preloadLogo } from ' import { wheelApi } from '../../api/wheel' import { themeColorsApi } from '../../api/themeColors' import { promoApi } from '../../api/promo' +import { referralApi } from '../../api/referral' import { useTheme } from '../../hooks/useTheme' import { useTelegramWebApp } from '../../hooks/useTelegramWebApp' import { usePullToRefresh } from '../../hooks/usePullToRefresh' @@ -295,6 +296,15 @@ export default function Layout({ children }: LayoutProps) { retry: false, }) + // Fetch referral terms to check if enabled + const { data: referralTerms } = useQuery({ + queryKey: ['referral-terms'], + queryFn: referralApi.getReferralTerms, + enabled: isAuthenticated, + staleTime: 60000, // 1 minute + retry: false, + }) + // Fetch active discount to determine mobile layout const { data: activeDiscount } = useQuery({ queryKey: ['active-discount'], @@ -311,10 +321,15 @@ export default function Layout({ children }: LayoutProps) { { path: '/', label: t('nav.dashboard'), icon: HomeIcon }, { path: '/subscription', label: t('nav.subscription'), icon: SubscriptionIcon }, { path: '/balance', label: t('nav.balance'), icon: WalletIcon }, - { path: '/referral', label: t('nav.referral'), icon: UsersIcon }, - { path: '/support', label: t('nav.support'), icon: ChatIcon }, ] + // Only show referral if program is enabled + if (referralTerms?.is_enabled) { + items.push({ path: '/referral', label: t('nav.referral'), icon: UsersIcon }) + } + + items.push({ path: '/support', label: t('nav.support'), icon: ChatIcon }) + // Only show contests if there are available contests if (contestsCount && contestsCount.count > 0) { items.push({ path: '/contests', label: t('nav.contests'), icon: GamepadIcon }) @@ -328,7 +343,7 @@ export default function Layout({ children }: LayoutProps) { items.push({ path: '/info', label: t('nav.info'), icon: InfoIcon }) return items - }, [t, contestsCount, pollsCount]) + }, [t, contestsCount, pollsCount, referralTerms]) // Separate navItems for desktop that includes wheel (if enabled) const desktopNavItems = useMemo(() => { From 4e225c78bf9e8d756f3d2733972173d7f65acc2a Mon Sep 17 00:00:00 2001 From: Egor Date: Wed, 21 Jan 2026 05:31:58 +0300 Subject: [PATCH 2/3] Update Referral.tsx --- src/pages/Referral.tsx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/pages/Referral.tsx b/src/pages/Referral.tsx index 70f9fd8..3febac8 100644 --- a/src/pages/Referral.tsx +++ b/src/pages/Referral.tsx @@ -137,6 +137,35 @@ export default function Referral() { ) } + // Show disabled state if referral program is disabled + if (terms && !terms.is_enabled) { + return ( +
+
+ + + +
+
+

+ {t('referral.title')} +

+

{t('referral.disabled')}

+
+
+ ) + } + return (

From 3532d26ffa7f3c3e55f26287f4f9bbf6d97ed01a Mon Sep 17 00:00:00 2001 From: Egor Date: Wed, 21 Jan 2026 05:32:27 +0300 Subject: [PATCH 3/3] Add files via upload --- src/locales/en.json | 3 ++- src/locales/fa.json | 3 ++- src/locales/ru.json | 3 ++- src/locales/zh.json | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 3adae1c..34f86ed 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -384,7 +384,8 @@ "referral_first_payment": "Referral First Payment", "referral_subscription_renewal": "Referral Subscription Renewal", "referral_bonus": "Referral Bonus" - } + }, + "disabled": "Referral program is currently disabled" }, "support": { "title": "Support", diff --git a/src/locales/fa.json b/src/locales/fa.json index acf2eaa..551a37f 100644 --- a/src/locales/fa.json +++ b/src/locales/fa.json @@ -272,7 +272,8 @@ "referral_first_payment": "اولین پرداخت کاربر معرفی‌شده", "referral_subscription_renewal": "تمدید اشتراک کاربر معرفی‌شده", "referral_bonus": "پاداش کاربر معرفی‌شده" - } + }, + "disabled": "برنامه معرفی موقتاً غیرفعال است" }, "support": { "title": "پشتیبانی", diff --git a/src/locales/ru.json b/src/locales/ru.json index a4a08fa..7a6a45b 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -384,7 +384,8 @@ "referral_first_payment": "Первая оплата реферала", "referral_subscription_renewal": "Продление подписки реферала", "referral_bonus": "Бонус за реферала" - } + }, + "disabled": "Реферальная программа временно отключена" }, "support": { "title": "Поддержка", diff --git a/src/locales/zh.json b/src/locales/zh.json index 4396784..390b666 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -273,7 +273,8 @@ "referral_first_payment": "推荐用户首次付款", "referral_subscription_renewal": "推荐用户续订", "referral_bonus": "推荐奖金" - } + }, + "disabled": "推荐计划暂时停用" }, "support": { "title": "支持",