fix: replace hardcoded green with theme-aware accent color

Normal traffic zone now uses configurable accent palette instead of
hardcoded success/green. Added useTrafficZone hook that resolves
mainHex dynamically from theme colors. Replaced emerald/teal classes
with success palette in SuccessNotificationModal. Fixed hardcoded
green hex values in Subscription and SubscriptionPurchase pages.
This commit is contained in:
Fringg
2026-03-04 02:50:28 +03:00
parent f652936d78
commit a3ddddfa8c
8 changed files with 76 additions and 44 deletions

View File

@@ -1,10 +1,9 @@
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router';
import type { Subscription } from '../../types';
import { useCurrency } from '../../hooks/useCurrency';
import { useTheme } from '../../hooks/useTheme';
import { getTrafficZone } from '../../utils/trafficZone';
import { useTrafficZone } from '../../hooks/useTrafficZone';
import { getGlassColors } from '../../utils/glassTheme';
interface StatsGridProps {
@@ -46,10 +45,7 @@ export default function StatsGrid({
const { isDark } = useTheme();
const g = getGlassColors(isDark);
const zone = useMemo(
() => getTrafficZone(subscription?.traffic_used_percent ?? 0),
[subscription?.traffic_used_percent],
);
const zone = useTrafficZone(subscription?.traffic_used_percent ?? 0);
const cards = [
{