refactor(theme): update color classes
This commit is contained in:
+1
-9
@@ -102,17 +102,9 @@ export function ConsumptionDistributionChart(
|
||||
props.loading ? [] : props.data,
|
||||
timeGranularity,
|
||||
t,
|
||||
customization.preset,
|
||||
chartRadius
|
||||
),
|
||||
[
|
||||
props.data,
|
||||
props.loading,
|
||||
timeGranularity,
|
||||
t,
|
||||
customization.preset,
|
||||
chartRadius,
|
||||
]
|
||||
[props.data, props.loading, timeGranularity, t, chartRadius]
|
||||
)
|
||||
const spec = chartType === 'bar' ? chartData.spec_line : chartData.spec_area
|
||||
const specType = typeof spec?.type === 'string' ? spec.type : chartType
|
||||
|
||||
@@ -100,17 +100,9 @@ export function ModelCharts(props: ModelChartsProps) {
|
||||
props.loading ? [] : props.data,
|
||||
timeGranularity,
|
||||
t,
|
||||
customization.preset,
|
||||
chartRadius
|
||||
),
|
||||
[
|
||||
props.data,
|
||||
props.loading,
|
||||
timeGranularity,
|
||||
t,
|
||||
customization.preset,
|
||||
chartRadius,
|
||||
]
|
||||
[props.data, props.loading, timeGranularity, t, chartRadius]
|
||||
)
|
||||
|
||||
const spec = chartData[CHART_SPEC_KEYS[activeTab]]
|
||||
|
||||
@@ -30,10 +30,10 @@ import type {
|
||||
import { PanelWrapper } from '../ui/panel-wrapper'
|
||||
|
||||
const STATUS_COLOR_MAP: Record<number, string> = {
|
||||
1: 'bg-success',
|
||||
0: 'bg-destructive',
|
||||
2: 'bg-warning',
|
||||
3: 'bg-info',
|
||||
1: 'bg-emerald-500',
|
||||
0: 'bg-red-500',
|
||||
2: 'bg-amber-500',
|
||||
3: 'bg-blue-500',
|
||||
}
|
||||
const DEFAULT_STATUS_COLOR = 'bg-muted-foreground/40'
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import { Users, Loader2 } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { getRollingDateRange, type TimeGranularity } from '@/lib/time'
|
||||
import { VCHART_OPTION } from '@/lib/vchart'
|
||||
import { useThemeCustomization } from '@/context/theme-customization-provider'
|
||||
import { useTheme } from '@/context/theme-provider'
|
||||
import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
@@ -66,7 +65,6 @@ const TOP_USER_LIMIT_OPTIONS = [5, 10, 20, 50]
|
||||
export function UserCharts() {
|
||||
const { t } = useTranslation()
|
||||
const { resolvedTheme } = useTheme()
|
||||
const { customization } = useThemeCustomization()
|
||||
const [themeReady, setThemeReady] = useState(false)
|
||||
const themeManagerRef = useRef<
|
||||
(typeof import('@visactor/vchart'))['ThemeManager'] | null
|
||||
@@ -138,18 +136,9 @@ export function UserCharts() {
|
||||
isLoading ? [] : (userData ?? []),
|
||||
timeGranularity,
|
||||
t,
|
||||
topUserLimit,
|
||||
customization.preset
|
||||
topUserLimit
|
||||
),
|
||||
[
|
||||
userData,
|
||||
isLoading,
|
||||
timeGranularity,
|
||||
t,
|
||||
topUserLimit,
|
||||
customization.preset,
|
||||
customization.radius,
|
||||
]
|
||||
[userData, isLoading, timeGranularity, t, topUserLimit]
|
||||
)
|
||||
|
||||
return (
|
||||
@@ -240,7 +229,7 @@ export function UserCharts() {
|
||||
themeReady &&
|
||||
spec && (
|
||||
<VChart
|
||||
key={`user-${chart.value}-${topUserLimit}-${resolvedTheme}-${customization.preset}`}
|
||||
key={`user-${chart.value}-${topUserLimit}-${resolvedTheme}`}
|
||||
spec={{
|
||||
...spec,
|
||||
theme: resolvedTheme === 'dark' ? 'dark' : 'light',
|
||||
|
||||
Reference in New Issue
Block a user