From 8f41e25696359237d7fabf4b3c3e5a811e7f95dc Mon Sep 17 00:00:00 2001
From: DrSmoothl <1787882683@qq.com>
Date: Thu, 5 Mar 2026 22:10:32 +0800
Subject: [PATCH] fix(dashboard): resolve TS build errors in a11y changes
- Fix duplicate className attr in EmojiDialogs.tsx
- Replace animated.div with animated('div') in expression-reviewer and zoomable-chart to fix React 19 children type error
- Fix malformed i18n JSON (a11y namespace was outside root object)
---
dashboard/src/components/expression-reviewer.tsx | 7 ++++---
dashboard/src/components/ui/zoomable-chart.tsx | 6 ++++--
dashboard/src/i18n/locales/en.json | 1 +
dashboard/src/i18n/locales/ja.json | 1 +
dashboard/src/i18n/locales/ko.json | 1 +
dashboard/src/i18n/locales/zh.json | 1 +
dashboard/src/routes/resource/emoji/EmojiDialogs.tsx | 5 -----
7 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/dashboard/src/components/expression-reviewer.tsx b/dashboard/src/components/expression-reviewer.tsx
index 002eb206..8373c840 100644
--- a/dashboard/src/components/expression-reviewer.tsx
+++ b/dashboard/src/components/expression-reviewer.tsx
@@ -9,6 +9,8 @@
*/
import { animated, useSpring } from '@react-spring/web'
+
+const AnimatedDiv = animated('div')
import { useCallback, useEffect, useRef, useState } from 'react'
import {
Dialog,
@@ -1443,7 +1445,6 @@ export function ExpressionReviewer({ open, onOpenChange }: ExpressionReviewerPro
aria-label="待审核的表达方式"
aria-activedescendant={quickExpressions[quickCurrentIndex] ? `quick-expr-${quickExpressions[quickCurrentIndex].id}` : undefined}
>
-
{quickExpressions
.slice(quickCurrentIndex, quickCurrentIndex + 5)
.reverse()
@@ -1504,7 +1505,7 @@ if (isCurrent) {
}
return isCurrent ? (
-
{formatTime(expr.create_date)}
-
+
) : (
)
}
diff --git a/dashboard/src/i18n/locales/en.json b/dashboard/src/i18n/locales/en.json
index e9cbb69f..869b9994 100644
--- a/dashboard/src/i18n/locales/en.json
+++ b/dashboard/src/i18n/locales/en.json
@@ -473,4 +473,5 @@
"sidebarNav": "Main navigation",
"closeMenu": "Close menu",
"navigatedTo": "Navigated to {{page}}"
+ }
}
diff --git a/dashboard/src/i18n/locales/ja.json b/dashboard/src/i18n/locales/ja.json
index 9d8f218d..924b1385 100644
--- a/dashboard/src/i18n/locales/ja.json
+++ b/dashboard/src/i18n/locales/ja.json
@@ -473,4 +473,5 @@
"sidebarNav": "メインナビゲーション",
"closeMenu": "メニューを閉じる",
"navigatedTo": "{{page}} に移動しました"
+ }
}
diff --git a/dashboard/src/i18n/locales/ko.json b/dashboard/src/i18n/locales/ko.json
index f793c06a..0233cd57 100644
--- a/dashboard/src/i18n/locales/ko.json
+++ b/dashboard/src/i18n/locales/ko.json
@@ -473,4 +473,5 @@
"sidebarNav": "메인 내비게이션",
"closeMenu": "메뉴 닫기",
"navigatedTo": "{{page}}으로 이동했습니다"
+ }
}
diff --git a/dashboard/src/i18n/locales/zh.json b/dashboard/src/i18n/locales/zh.json
index 07f6e65a..e21e1ce6 100644
--- a/dashboard/src/i18n/locales/zh.json
+++ b/dashboard/src/i18n/locales/zh.json
@@ -473,4 +473,5 @@
"sidebarNav": "主导航",
"closeMenu": "关闭菜单",
"navigatedTo": "已导航至 {{page}}"
+ }
}
diff --git a/dashboard/src/routes/resource/emoji/EmojiDialogs.tsx b/dashboard/src/routes/resource/emoji/EmojiDialogs.tsx
index e7b28221..b61a82e6 100644
--- a/dashboard/src/routes/resource/emoji/EmojiDialogs.tsx
+++ b/dashboard/src/routes/resource/emoji/EmojiDialogs.tsx
@@ -781,11 +781,6 @@ export function EmojiUploadDialog({
${isSelected ? 'ring-2 ring-primary' : ''}
${complete ? 'border-green-500 bg-green-50 dark:bg-green-950/20' : 'border-border hover:border-muted-foreground/50'}
`}
- className={`
- flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-all
- ${isSelected ? 'ring-2 ring-primary' : ''}
- ${complete ? 'border-green-500 bg-green-50 dark:bg-green-950/20' : 'border-border hover:border-muted-foreground/50'}
- `}
>