+
{t('subscription.switchTariff.free')}
) : (
@@ -1570,7 +1572,7 @@ export default function Subscription() {
{/* Discount badge */}
{pkg.discount_percent && pkg.discount_percent > 0 && (
-
+
-{pkg.discount_percent}%
@@ -1971,7 +1973,10 @@ export default function Subscription() {
) : devicesData && devicesData.devices.length > 0 ? (
diff --git a/src/pages/SubscriptionPurchase.tsx b/src/pages/SubscriptionPurchase.tsx
index 9e91891..e5c96ab 100644
--- a/src/pages/SubscriptionPurchase.tsx
+++ b/src/pages/SubscriptionPurchase.tsx
@@ -577,7 +577,7 @@ export default function SubscriptionPurchase() {
{t('subscription.switchTariff.upgradeCost')}
{switchPreview.discount_percent && switchPreview.discount_percent > 0 && (
-
+
-{switchPreview.discount_percent}%
)}
@@ -592,7 +592,7 @@ export default function SubscriptionPurchase() {
)}
{switchPreview.upgrade_cost_kopeks > 0
? switchPreview.upgrade_cost_label
diff --git a/src/utils/trafficZone.ts b/src/utils/trafficZone.ts
index d1855d6..f2c9b2d 100644
--- a/src/utils/trafficZone.ts
+++ b/src/utils/trafficZone.ts
@@ -1,5 +1,7 @@
export type TrafficZone = 'normal' | 'warning' | 'danger' | 'critical';
+export type TrafficColorKey = 'accent' | 'warning' | 'error';
+
interface TrafficZoneResult {
zone: TrafficZone;
textClass: string;
@@ -8,19 +10,19 @@ interface TrafficZoneResult {
labelKey: string;
gradientFrom: string;
gradientTo: string;
- /** Hex color for inline styles */
- mainHex: string;
+ /** Key into ThemeColors for resolving mainHex at runtime */
+ colorKey: TrafficColorKey;
}
const ZONES: Record> = {
normal: {
- textClass: 'text-success-400',
- dotClass: 'bg-success-400',
- glowColor: 'rgba(var(--color-success-500), 0.5)',
+ textClass: 'text-accent-400',
+ dotClass: 'bg-accent-400',
+ glowColor: 'rgba(var(--color-accent-500), 0.5)',
labelKey: 'dashboard.zone.normal',
- gradientFrom: 'rgb(var(--color-success-500))',
- gradientTo: 'rgb(var(--color-success-400))',
- mainHex: '#00E5A0',
+ gradientFrom: 'rgb(var(--color-accent-500))',
+ gradientTo: 'rgb(var(--color-accent-400))',
+ colorKey: 'accent',
},
warning: {
textClass: 'text-warning-400',
@@ -29,7 +31,7 @@ const ZONES: Record> = {
labelKey: 'dashboard.zone.warning',
gradientFrom: 'rgb(var(--color-warning-500))',
gradientTo: 'rgb(var(--color-warning-400))',
- mainHex: '#FFB800',
+ colorKey: 'warning',
},
danger: {
textClass: 'text-warning-300',
@@ -38,7 +40,7 @@ const ZONES: Record> = {
labelKey: 'dashboard.zone.danger',
gradientFrom: 'rgb(var(--color-warning-600))',
gradientTo: 'rgb(var(--color-warning-400))',
- mainHex: '#FF6B35',
+ colorKey: 'warning',
},
critical: {
textClass: 'text-error-400',
@@ -47,7 +49,7 @@ const ZONES: Record> = {
labelKey: 'dashboard.zone.critical',
gradientFrom: 'rgb(var(--color-error-500))',
gradientTo: 'rgb(var(--color-error-400))',
- mainHex: '#FF3B5C',
+ colorKey: 'error',
},
};