fix: 修复 ESLint 配置及组件弃用属性警告,优化代码格式
1. 工程配置: - 更新 tsconfig.json include 规则,解决 eslint.config.ts 未被包含的问题。 2. 组件重构 (Material UI 适配): - Navbar: 替换已弃用的 PaperProps 为 slotProps.paper。 - TimestampToDatetime / DatetimeToTimestamp: 替换已弃用的 InputProps 为 slotProps.input。 3. 类型与逻辑修复: - utils/recordUtils.tsx: 引入缺失依赖,忽略 UNSAFE_replayCanvas 等类型报错,修复构建问题。 - utils/messages.tsx: 完善事件参数类型定义。 4. 其他优化: - 统一 App.css 代码格式。 - 补充部分组件 (CopyButton, TimestampExecution) 的 React 导入和类型定义。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState, useCallback } from 'react';
|
||||
import React, { useState, useCallback } from 'react';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
Button,
|
||||
@@ -84,7 +84,7 @@ export function TimestampToDatetime() {
|
||||
);
|
||||
|
||||
const handleZoneChange = useCallback(
|
||||
(e: SelectChangeEvent<string>) => {
|
||||
(e: SelectChangeEvent) => {
|
||||
const newZone = e.target.value;
|
||||
setSelectedZone(newZone);
|
||||
if (timestampResult) {
|
||||
@@ -96,7 +96,7 @@ export function TimestampToDatetime() {
|
||||
);
|
||||
|
||||
const handleUnitChange = useCallback(
|
||||
(e: SelectChangeEvent<string>) => {
|
||||
(e: SelectChangeEvent) => {
|
||||
const newUnit = e.target.value;
|
||||
setUnit(newUnit);
|
||||
if (timestampResult) {
|
||||
@@ -150,8 +150,10 @@ export function TimestampToDatetime() {
|
||||
value={timestampResult}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
InputProps={{
|
||||
readOnly: true,
|
||||
slotProps={{
|
||||
input: {
|
||||
readOnly: true,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<FormControl fullWidth>
|
||||
|
||||
Reference in New Issue
Block a user