From d623cd41e9e9e15733c68b9640f0296f37043468 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Mon, 2 Feb 2026 01:58:15 +0300 Subject: [PATCH] fix: AdminTariffCreate back button and daily tariff colors - AdminBackButton now navigates to /admin/tariffs instead of /admin - Fixed dynamic Tailwind classes for daily tariff (warning colors) - Tabs, servers, and reset mode buttons now use proper warning colors for daily tariffs --- src/pages/AdminTariffCreate.tsx | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/pages/AdminTariffCreate.tsx b/src/pages/AdminTariffCreate.tsx index a326b91..e162ed8 100644 --- a/src/pages/AdminTariffCreate.tsx +++ b/src/pages/AdminTariffCreate.tsx @@ -284,7 +284,7 @@ export default function AdminTariffCreate() { return (
- +

{t('admin.tariffs.selectType')}

{t('admin.tariffs.selectTypeDesc')}

@@ -326,15 +326,18 @@ export default function AdminTariffCreate() { } const isDaily = tariffType === 'daily'; - const accentColor = isDaily ? 'warning' : 'accent'; return (
{/* Header */}
- +
-
+
{isDaily ? : }
@@ -366,7 +369,9 @@ export default function AdminTariffCreate() { onClick={() => setActiveTab(tab)} className={`shrink-0 whitespace-nowrap rounded-xl px-4 py-2.5 text-sm font-medium transition-all ${ activeTab === tab - ? `bg-${accentColor}-500/15 text-${accentColor}-400 ring-1 ring-${accentColor}-500/30` + ? isDaily + ? 'bg-warning-500/15 text-warning-400 ring-1 ring-warning-500/30' + : 'bg-accent-500/15 text-accent-400 ring-1 ring-accent-500/30' : 'bg-dark-800/50 text-dark-400 hover:bg-dark-700' }`} > @@ -592,13 +597,19 @@ export default function AdminTariffCreate() { onClick={() => toggleServer(server.squad_uuid)} className={`flex w-full items-center gap-3 rounded-lg p-3 text-left transition-colors ${ isSelected - ? `bg-${accentColor}-500/20 text-${accentColor}-300` + ? isDaily + ? 'bg-warning-500/20 text-warning-300' + : 'bg-accent-500/20 text-accent-300' : 'bg-dark-800 text-dark-300 hover:bg-dark-700' }`} >
{isSelected && } @@ -890,7 +901,9 @@ export default function AdminTariffCreate() { onClick={() => setTrafficResetMode(option.value)} className={`rounded-lg p-3 text-left text-sm transition-colors ${ trafficResetMode === option.value - ? `bg-${accentColor}-500/20 text-${accentColor}-300 ring-1 ring-${accentColor}-500/30` + ? isDaily + ? 'bg-warning-500/20 text-warning-300 ring-1 ring-warning-500/30' + : 'bg-accent-500/20 text-accent-300 ring-1 ring-accent-500/30' : 'bg-dark-800 text-dark-300 hover:bg-dark-700' }`} >