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)
This commit is contained in:
@@ -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}
|
||||
>
|
||||
<div className="relative w-full max-w-md h-[400px] flex items-center justify-center">
|
||||
{quickExpressions
|
||||
.slice(quickCurrentIndex, quickCurrentIndex + 5)
|
||||
.reverse()
|
||||
@@ -1504,7 +1505,7 @@ if (isCurrent) {
|
||||
}
|
||||
|
||||
return isCurrent ? (
|
||||
<animated.div
|
||||
<AnimatedDiv
|
||||
key={expr.id}
|
||||
ref={cardRef}
|
||||
role="option"
|
||||
@@ -1588,7 +1589,7 @@ if (isCurrent) {
|
||||
</div>
|
||||
<span className="font-mono">{formatTime(expr.create_date)}</span>
|
||||
</div>
|
||||
</animated.div>
|
||||
</AnimatedDiv>
|
||||
) : (
|
||||
<div
|
||||
key={expr.id}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
import { useRef } from 'react'
|
||||
import { animated, useSpring } from '@react-spring/web'
|
||||
|
||||
const AnimatedDiv = animated('div')
|
||||
import { usePinch } from '@use-gesture/react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
@@ -82,9 +84,9 @@ export function ZoomableChart({
|
||||
className={cn('overflow-hidden touch-none select-none', className)}
|
||||
style={{ touchAction: 'none' }}
|
||||
>
|
||||
<animated.div style={style} className="w-full h-full origin-center">
|
||||
<AnimatedDiv style={style} className="w-full h-full origin-center">
|
||||
{children}
|
||||
</animated.div>
|
||||
</AnimatedDiv>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user