mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
feat(i18n): migrate all hardcoded Russian text to i18n
- Replace all hardcoded Russian strings with t() calls across 30+ files - Add ~500 new translation keys to all 4 locales (ru, en, zh, fa) - Convert module-level config objects to labelKey pattern - Remove Russian fallbacks from t() calls (fallbackLng handles it) - Replace DeepLinkRedirect custom i18n with standard t() calls - Fix subscription.servers key collision (string vs object)
This commit is contained in:
@@ -453,7 +453,7 @@ export default function ConnectionModal({ onClose }: ConnectionModalProps) {
|
||||
<BackIcon />
|
||||
</button>
|
||||
<h2 className="text-lg font-bold text-dark-100">
|
||||
{t('subscription.connection.selectPlatform') || 'Выберите платформу'}
|
||||
{t('subscription.connection.selectPlatform')}
|
||||
</h2>
|
||||
</div>
|
||||
<div className="space-y-2 p-4">
|
||||
@@ -498,8 +498,8 @@ export default function ConnectionModal({ onClose }: ConnectionModalProps) {
|
||||
<span className="text-sm text-dark-400">
|
||||
{appCount}{' '}
|
||||
{appCount === 1
|
||||
? t('subscription.connection.app') || 'приложение'
|
||||
: t('subscription.connection.apps') || 'приложений'}
|
||||
? t('subscription.connection.app')
|
||||
: t('subscription.connection.apps')}
|
||||
</span>
|
||||
</div>
|
||||
<ChevronIcon />
|
||||
@@ -623,9 +623,7 @@ export default function ConnectionModal({ onClose }: ConnectionModalProps) {
|
||||
</div>
|
||||
<div className="flex-1 text-left">
|
||||
<div className="font-medium text-dark-100">{selectedApp?.name}</div>
|
||||
<div className="text-sm text-dark-400">
|
||||
{t('subscription.connection.changeApp') || 'Сменить приложение'}
|
||||
</div>
|
||||
<div className="text-sm text-dark-400">{t('subscription.connection.changeApp')}</div>
|
||||
</div>
|
||||
<ChevronIcon />
|
||||
</button>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { promoApi, PromoOffer } from '../api/promo';
|
||||
|
||||
// Icons
|
||||
@@ -50,7 +51,10 @@ const ServerIcon = () => (
|
||||
);
|
||||
|
||||
// Helper functions
|
||||
const formatTimeLeft = (expiresAt: string): string => {
|
||||
const formatTimeLeft = (
|
||||
expiresAt: string,
|
||||
t: (key: string, options?: Record<string, unknown>) => string,
|
||||
): string => {
|
||||
const now = new Date();
|
||||
// Ensure UTC parsing - if no timezone specified, assume UTC
|
||||
let expires: Date;
|
||||
@@ -62,19 +66,19 @@ const formatTimeLeft = (expiresAt: string): string => {
|
||||
}
|
||||
const diffMs = expires.getTime() - now.getTime();
|
||||
|
||||
if (diffMs <= 0) return 'Истекло';
|
||||
if (diffMs <= 0) return t('promo.offers.expired');
|
||||
|
||||
const hours = Math.floor(diffMs / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60));
|
||||
|
||||
if (hours > 24) {
|
||||
const days = Math.floor(hours / 24);
|
||||
return `${days} дн.`;
|
||||
return `${days} ${t('promo.time.days')}`;
|
||||
}
|
||||
if (hours > 0) {
|
||||
return `${hours}ч ${minutes}м`;
|
||||
return `${hours}${t('promo.time.hours')} ${minutes}${t('promo.time.minutes')}`;
|
||||
}
|
||||
return `${minutes}м`;
|
||||
return `${minutes}${t('promo.time.minutes')}`;
|
||||
};
|
||||
|
||||
const getOfferIcon = (effectType: string) => {
|
||||
@@ -82,22 +86,30 @@ const getOfferIcon = (effectType: string) => {
|
||||
return <SparklesIcon />;
|
||||
};
|
||||
|
||||
const getOfferTitle = (offer: PromoOffer): string => {
|
||||
const getOfferTitle = (
|
||||
offer: PromoOffer,
|
||||
t: (key: string, options?: Record<string, unknown>) => string,
|
||||
): string => {
|
||||
if (offer.effect_type === 'test_access') {
|
||||
return 'Тестовый доступ';
|
||||
return t('promo.offers.testAccess');
|
||||
}
|
||||
if (offer.discount_percent) {
|
||||
return `Скидка ${offer.discount_percent}%`;
|
||||
return t('promo.offers.discountPercent', { percent: offer.discount_percent });
|
||||
}
|
||||
return 'Специальное предложение';
|
||||
return t('promo.offers.specialOffer');
|
||||
};
|
||||
|
||||
const getOfferDescription = (offer: PromoOffer): string => {
|
||||
const getOfferDescription = (
|
||||
offer: PromoOffer,
|
||||
t: (key: string, options?: Record<string, unknown>) => string,
|
||||
): string => {
|
||||
if (offer.effect_type === 'test_access') {
|
||||
const squads = offer.extra_data?.test_squad_uuids?.length || 0;
|
||||
return squads > 0 ? `Доступ к ${squads} серверам` : 'Доступ к дополнительным серверам';
|
||||
return squads > 0
|
||||
? t('promo.offers.serverAccess', { count: squads })
|
||||
: t('promo.offers.additionalServers');
|
||||
}
|
||||
return 'Активируйте скидку на покупку подписки';
|
||||
return t('promo.offers.activateDiscountHint');
|
||||
};
|
||||
|
||||
interface PromoOffersSectionProps {
|
||||
@@ -105,6 +117,7 @@ interface PromoOffersSectionProps {
|
||||
}
|
||||
|
||||
export default function PromoOffersSection({ className = '' }: PromoOffersSectionProps) {
|
||||
const { t } = useTranslation();
|
||||
const queryClient = useQueryClient();
|
||||
const [claimingId, setClaimingId] = useState<number | null>(null);
|
||||
const [successMessage, setSuccessMessage] = useState<string | null>(null);
|
||||
@@ -137,7 +150,7 @@ export default function PromoOffersSection({ className = '' }: PromoOffersSectio
|
||||
},
|
||||
onError: (error: unknown) => {
|
||||
const axiosErr = error as { response?: { data?: { detail?: string } } };
|
||||
setErrorMessage(axiosErr.response?.data?.detail || 'Не удалось активировать предложение');
|
||||
setErrorMessage(axiosErr.response?.data?.detail || t('promo.offers.activationFailed'));
|
||||
setClaimingId(null);
|
||||
setTimeout(() => setErrorMessage(null), 5000);
|
||||
},
|
||||
@@ -174,17 +187,23 @@ export default function PromoOffersSection({ className = '' }: PromoOffersSectio
|
||||
<div className="flex-1">
|
||||
<div className="mb-1 flex items-center gap-2">
|
||||
<h3 className="font-semibold text-dark-100">
|
||||
Скидка {activeDiscount.discount_percent}% активна
|
||||
{t('promo.offers.discountActiveTitle', {
|
||||
percent: activeDiscount.discount_percent,
|
||||
})}
|
||||
</h3>
|
||||
<span className="rounded bg-accent-500/20 px-2 py-0.5 text-xs text-accent-400">
|
||||
Действует
|
||||
{t('promo.offers.statusActive')}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-4 text-sm text-dark-400">
|
||||
{activeDiscount.expires_at && (
|
||||
<div className="flex items-center gap-1">
|
||||
<ClockIcon />
|
||||
<span>Истекает: {formatTimeLeft(activeDiscount.expires_at)}</span>
|
||||
<span>
|
||||
{t('promo.offers.expires', {
|
||||
time: formatTimeLeft(activeDiscount.expires_at, t),
|
||||
})}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -221,18 +240,20 @@ export default function PromoOffersSection({ className = '' }: PromoOffersSectio
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="mb-1 flex items-center gap-2">
|
||||
<h3 className="font-semibold text-dark-100">{getOfferTitle(offer)}</h3>
|
||||
<h3 className="font-semibold text-dark-100">{getOfferTitle(offer, t)}</h3>
|
||||
{offer.effect_type === 'test_access' && (
|
||||
<span className="rounded bg-purple-500/20 px-2 py-0.5 text-xs text-purple-400">
|
||||
Тест
|
||||
{t('promo.offers.test')}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<p className="mb-3 text-sm text-dark-400">{getOfferDescription(offer)}</p>
|
||||
<p className="mb-3 text-sm text-dark-400">{getOfferDescription(offer, t)}</p>
|
||||
<div className="flex items-center justify-between gap-4">
|
||||
<div className="flex items-center gap-1 text-xs text-dark-500">
|
||||
<ClockIcon />
|
||||
<span>Осталось: {formatTimeLeft(offer.expires_at)}</span>
|
||||
<span>
|
||||
{t('promo.offers.remaining', { time: formatTimeLeft(offer.expires_at, t) })}
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => handleClaim(offer.id)}
|
||||
@@ -242,12 +263,12 @@ export default function PromoOffersSection({ className = '' }: PromoOffersSectio
|
||||
{claimingId === offer.id ? (
|
||||
<>
|
||||
<div className="h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" />
|
||||
<span>Активация...</span>
|
||||
<span>{t('promo.offers.activating')}</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<GiftIcon />
|
||||
<span>Активировать</span>
|
||||
<span>{t('promo.offers.activate')}</span>
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
|
||||
@@ -204,11 +204,11 @@ export default function TopUpModal({ method, onClose, initialAmountRubles }: Top
|
||||
onSuccess: (data) => {
|
||||
const webApp = window.Telegram?.WebApp;
|
||||
if (!data.invoice_url) {
|
||||
setError('Сервер не вернул ссылку на оплату');
|
||||
setError(t('balance.errors.noPaymentLink'));
|
||||
return;
|
||||
}
|
||||
if (!webApp?.openInvoice) {
|
||||
setError('Оплата Stars доступна только в Telegram Mini App');
|
||||
setError(t('balance.errors.starsOnlyInTelegram'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -221,12 +221,12 @@ export default function TopUpModal({ method, onClose, initialAmountRubles }: Top
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
setError('Ошибка: ' + String(e));
|
||||
setError(t('balance.errors.generic', { details: String(e) }));
|
||||
}
|
||||
},
|
||||
onError: (err: unknown) => {
|
||||
const axiosError = err as { response?: { data?: { detail?: string }; status?: number } };
|
||||
setError(`Ошибка: ${axiosError?.response?.data?.detail || 'Не удалось создать счёт'}`);
|
||||
setError(axiosError?.response?.data?.detail || t('balance.errors.invoiceFailed'));
|
||||
},
|
||||
});
|
||||
|
||||
@@ -268,21 +268,23 @@ export default function TopUpModal({ method, onClose, initialAmountRubles }: Top
|
||||
inputRef.current?.blur();
|
||||
|
||||
if (!checkRateLimit(RATE_LIMIT_KEYS.PAYMENT, 3, 30000)) {
|
||||
setError('Подождите ' + getRateLimitResetTime(RATE_LIMIT_KEYS.PAYMENT) + ' сек.');
|
||||
setError(
|
||||
t('balance.errors.rateLimit', { seconds: getRateLimitResetTime(RATE_LIMIT_KEYS.PAYMENT) }),
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (hasOptions && !selectedOption) {
|
||||
setError('Выберите способ');
|
||||
setError(t('balance.errors.selectMethod'));
|
||||
return;
|
||||
}
|
||||
const amountCurrency = parseFloat(amount);
|
||||
if (isNaN(amountCurrency) || amountCurrency <= 0) {
|
||||
setError('Введите сумму');
|
||||
setError(t('balance.errors.enterAmount'));
|
||||
return;
|
||||
}
|
||||
const amountRubles = convertToRub(amountCurrency);
|
||||
if (amountRubles < minRubles || amountRubles > maxRubles) {
|
||||
setError(`Сумма: ${minRubles} – ${maxRubles} ₽`);
|
||||
setError(t('balance.errors.amountRange', { min: minRubles, max: maxRubles }));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -498,17 +500,10 @@ export default function TopUpModal({ method, onClose, initialAmountRubles }: Top
|
||||
<div className="space-y-3 rounded-2xl border border-success-500/20 bg-success-500/10 p-4">
|
||||
<div className="flex items-center gap-2 text-success-400">
|
||||
<CheckIcon />
|
||||
<span className="font-semibold">
|
||||
{t('balance.paymentReady', 'Ссылка на оплату готова')}
|
||||
</span>
|
||||
<span className="font-semibold">{t('balance.paymentReady')}</span>
|
||||
</div>
|
||||
|
||||
<p className="text-sm text-dark-400">
|
||||
{t(
|
||||
'balance.clickToOpenPayment',
|
||||
'Нажмите кнопку ниже, чтобы открыть страницу оплаты в новой вкладке',
|
||||
)}
|
||||
</p>
|
||||
<p className="text-sm text-dark-400">{t('balance.clickToOpenPayment')}</p>
|
||||
|
||||
{/* Main open button - NO preventDefault, let <a> work natively for iOS Safari */}
|
||||
<a
|
||||
@@ -518,7 +513,7 @@ export default function TopUpModal({ method, onClose, initialAmountRubles }: Top
|
||||
className="flex h-12 w-full items-center justify-center gap-2 rounded-xl bg-success-500 font-bold text-white transition-colors hover:bg-success-400 active:bg-success-600"
|
||||
>
|
||||
<ExternalLinkIcon />
|
||||
<span>{t('balance.openPaymentPage', 'Открыть страницу оплаты')}</span>
|
||||
<span>{t('balance.openPaymentPage')}</span>
|
||||
</a>
|
||||
|
||||
{/* Copy and link display */}
|
||||
@@ -534,7 +529,7 @@ export default function TopUpModal({ method, onClose, initialAmountRubles }: Top
|
||||
? 'bg-success-500/20 text-success-400'
|
||||
: 'bg-dark-800/70 text-dark-400 hover:bg-dark-700 hover:text-dark-200'
|
||||
}`}
|
||||
title={t('common.copy', 'Копировать')}
|
||||
title={t('common.copy')}
|
||||
>
|
||||
{copied ? <CheckIcon /> : <CopyIcon />}
|
||||
</button>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useState, useRef, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SettingDefinition } from '../../api/adminSettings';
|
||||
import { CheckIcon, CloseIcon, EditIcon } from './icons';
|
||||
|
||||
@@ -32,6 +33,7 @@ function isListOrJsonKey(key: string): boolean {
|
||||
}
|
||||
|
||||
export function SettingInput({ setting, onUpdate, disabled }: SettingInputProps) {
|
||||
const { t } = useTranslation();
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const [value, setValue] = useState('');
|
||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
@@ -95,24 +97,24 @@ export function SettingInput({ setting, onUpdate, disabled }: SettingInputProps)
|
||||
if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) handleSave();
|
||||
}}
|
||||
autoFocus
|
||||
placeholder="Введите значение..."
|
||||
placeholder={t('admin.settings.inputPlaceholder')}
|
||||
className="min-h-[100px] w-full resize-none rounded-xl border border-accent-500 bg-dark-700 px-4 py-3 font-mono text-sm text-dark-100 focus:outline-none focus:ring-2 focus:ring-accent-500/30"
|
||||
/>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<span className="text-xs text-dark-500">Ctrl+Enter для сохранения</span>
|
||||
<span className="text-xs text-dark-500">{t('admin.settings.ctrlEnterHint')}</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
onClick={handleCancel}
|
||||
className="rounded-lg bg-dark-600 px-3 py-1.5 text-sm text-dark-300 transition-colors hover:bg-dark-500"
|
||||
>
|
||||
Отмена
|
||||
{t('admin.settings.cancelButton')}
|
||||
</button>
|
||||
<button
|
||||
onClick={handleSave}
|
||||
className="flex items-center gap-1.5 rounded-lg bg-accent-500 px-3 py-1.5 text-sm text-white transition-colors hover:bg-accent-600"
|
||||
>
|
||||
<CheckIcon />
|
||||
Сохранить
|
||||
{t('admin.settings.saveButton')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,20 +136,20 @@ export function SettingInput({ setting, onUpdate, disabled }: SettingInputProps)
|
||||
if (e.key === 'Escape') handleCancel();
|
||||
}}
|
||||
autoFocus
|
||||
placeholder="Введите значение..."
|
||||
placeholder={t('admin.settings.inputPlaceholder')}
|
||||
className="w-48 rounded-lg border border-accent-500 bg-dark-700 px-3 py-2 text-sm text-dark-100 focus:outline-none focus:ring-2 focus:ring-accent-500/30 sm:w-56"
|
||||
/>
|
||||
<button
|
||||
onClick={handleSave}
|
||||
className="rounded-lg bg-accent-500 p-2 text-white transition-colors hover:bg-accent-600"
|
||||
title="Сохранить (Enter)"
|
||||
title={t('admin.settings.saveHint')}
|
||||
>
|
||||
<CheckIcon />
|
||||
</button>
|
||||
<button
|
||||
onClick={handleCancel}
|
||||
className="rounded-lg bg-dark-600 p-2 text-dark-300 transition-colors hover:bg-dark-500"
|
||||
title="Отмена (Esc)"
|
||||
title={t('admin.settings.cancelHint')}
|
||||
>
|
||||
<CloseIcon />
|
||||
</button>
|
||||
|
||||
@@ -79,7 +79,11 @@ export function SettingRow({
|
||||
? 'bg-warning-500/15 text-warning-400 hover:bg-warning-500/25'
|
||||
: 'text-dark-500 opacity-0 hover:bg-dark-700/50 hover:text-warning-400 group-hover:opacity-100'
|
||||
}`}
|
||||
title={isFavorite ? 'Убрать из избранного' : 'В избранное'}
|
||||
title={
|
||||
isFavorite
|
||||
? t('admin.settings.removeFromFavorites')
|
||||
: t('admin.settings.addToFavorites')
|
||||
}
|
||||
>
|
||||
<StarIcon filled={isFavorite} />
|
||||
</button>
|
||||
@@ -105,7 +109,9 @@ export function SettingRow({
|
||||
// Boolean toggle
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<span className="text-sm text-dark-400">
|
||||
{setting.current === true || setting.current === 'true' ? 'Включено' : 'Выключено'}
|
||||
{setting.current === true || setting.current === 'true'
|
||||
? t('admin.settings.enabled')
|
||||
: t('admin.settings.disabled')}
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<Toggle
|
||||
@@ -161,7 +167,7 @@ export function SettingRow({
|
||||
title={t('admin.settings.reset')}
|
||||
>
|
||||
<RefreshIcon />
|
||||
<span>Сбросить</span>
|
||||
<span>{t('admin.settings.reset')}</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -74,14 +74,20 @@ export function SettingsSearchResults({
|
||||
searchQuery: string;
|
||||
resultsCount: number;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (!searchQuery.trim()) return null;
|
||||
|
||||
return (
|
||||
<div className="mt-3 flex items-center gap-2 text-sm">
|
||||
<span className="text-dark-400">
|
||||
{resultsCount > 0 ? `Найдено: ${resultsCount}` : 'Ничего не найдено'}
|
||||
{resultsCount > 0
|
||||
? t('admin.settings.foundCount', { count: resultsCount })
|
||||
: t('admin.settings.notFound')}
|
||||
</span>
|
||||
{resultsCount > 0 && <span className="text-dark-500">по запросу «{searchQuery}»</span>}
|
||||
{resultsCount > 0 && (
|
||||
<span className="text-dark-500">{t('admin.settings.byQuery', { query: searchQuery })}</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ export default function ChannelSubscriptionScreen() {
|
||||
error.response?.status === 403 &&
|
||||
error.response?.data?.detail?.code === 'channel_subscription_required'
|
||||
) {
|
||||
setError(t('blocking.channel.notSubscribed', 'Вы ещё не подписались на канал'));
|
||||
setError(t('blocking.channel.notSubscribed'));
|
||||
} else {
|
||||
// Other error - might be network issue
|
||||
setError(t('blocking.channel.checkError', 'Ошибка проверки. Попробуйте позже.'));
|
||||
setError(t('blocking.channel.checkError'));
|
||||
}
|
||||
} finally {
|
||||
setIsChecking(false);
|
||||
@@ -80,14 +80,11 @@ export default function ChannelSubscriptionScreen() {
|
||||
</div>
|
||||
|
||||
{/* Title */}
|
||||
<h1 className="mb-4 text-2xl font-bold text-white">
|
||||
{t('blocking.channel.title', 'Подписка на канал')}
|
||||
</h1>
|
||||
<h1 className="mb-4 text-2xl font-bold text-white">{t('blocking.channel.title')}</h1>
|
||||
|
||||
{/* Message */}
|
||||
<p className="mb-8 text-lg text-gray-400">
|
||||
{channelInfo?.message ||
|
||||
t('blocking.channel.defaultMessage', 'Для продолжения работы подпишитесь на наш канал')}
|
||||
{channelInfo?.message || t('blocking.channel.defaultMessage')}
|
||||
</p>
|
||||
|
||||
{/* Error message */}
|
||||
@@ -108,7 +105,7 @@ export default function ChannelSubscriptionScreen() {
|
||||
<svg className="h-5 w-5" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" />
|
||||
</svg>
|
||||
{t('blocking.channel.openChannel', 'Открыть канал')}
|
||||
{t('blocking.channel.openChannel')}
|
||||
</button>
|
||||
|
||||
{/* Check subscription button */}
|
||||
@@ -139,7 +136,7 @@ export default function ChannelSubscriptionScreen() {
|
||||
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
||||
></path>
|
||||
</svg>
|
||||
{t('blocking.channel.checking', 'Проверяем...')}
|
||||
{t('blocking.channel.checking')}
|
||||
</>
|
||||
) : cooldown > 0 ? (
|
||||
<>
|
||||
@@ -156,7 +153,7 @@ export default function ChannelSubscriptionScreen() {
|
||||
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
/>
|
||||
</svg>
|
||||
{t('blocking.channel.waitSeconds', 'Подождите {{seconds}} сек.', {
|
||||
{t('blocking.channel.waitSeconds', {
|
||||
seconds: cooldown,
|
||||
})}
|
||||
</>
|
||||
@@ -170,16 +167,14 @@ export default function ChannelSubscriptionScreen() {
|
||||
d="M5 13l4 4L19 7"
|
||||
/>
|
||||
</svg>
|
||||
{t('blocking.channel.checkSubscription', 'Проверить подписку')}
|
||||
{t('blocking.channel.checkSubscription')}
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Hint */}
|
||||
<p className="mt-6 text-sm text-gray-500">
|
||||
{t('blocking.channel.hint', 'После подписки нажмите кнопку проверки')}
|
||||
</p>
|
||||
<p className="mt-6 text-sm text-gray-500">{t('blocking.channel.hint')}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -28,25 +28,17 @@ export default function MaintenanceScreen() {
|
||||
</div>
|
||||
|
||||
{/* Title */}
|
||||
<h1 className="mb-4 text-2xl font-bold text-white">
|
||||
{t('blocking.maintenance.title', 'Технические работы')}
|
||||
</h1>
|
||||
<h1 className="mb-4 text-2xl font-bold text-white">{t('blocking.maintenance.title')}</h1>
|
||||
|
||||
{/* Message */}
|
||||
<p className="mb-6 text-lg text-gray-400">
|
||||
{maintenanceInfo?.message ||
|
||||
t(
|
||||
'blocking.maintenance.defaultMessage',
|
||||
'Сервис временно недоступен. Проводятся технические работы.',
|
||||
)}
|
||||
{maintenanceInfo?.message || t('blocking.maintenance.defaultMessage')}
|
||||
</p>
|
||||
|
||||
{/* Reason */}
|
||||
{maintenanceInfo?.reason && (
|
||||
<div className="mb-6 rounded-xl bg-dark-800/50 p-4">
|
||||
<p className="mb-1 text-sm text-gray-500">
|
||||
{t('blocking.maintenance.reason', 'Причина')}:
|
||||
</p>
|
||||
<p className="mb-1 text-sm text-gray-500">{t('blocking.maintenance.reason')}:</p>
|
||||
<p className="text-gray-300">{maintenanceInfo.reason}</p>
|
||||
</div>
|
||||
)}
|
||||
@@ -67,9 +59,7 @@ export default function MaintenanceScreen() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p className="mt-4 text-sm text-gray-500">
|
||||
{t('blocking.maintenance.waitMessage', 'Пожалуйста, подождите...')}
|
||||
</p>
|
||||
<p className="mt-4 text-sm text-gray-500">{t('blocking.maintenance.waitMessage')}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user