From 0fb69f83dfb00630ed17f835ceabe8f3620862cc Mon Sep 17 00:00:00 2001 From: rainnoon <101509477+rainnoon@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:13:22 +0800 Subject: [PATCH] feat: Centered in Error notebook (#841) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 解决输入空格导致下拉框启用的问题 * feat: "centered in error notebook" --------- Co-authored-by: 名称 <邮箱> Co-authored-by: boy --- src/pages/ErrorBook/ErrorRow.tsx | 2 +- src/pages/Gallery-N/ErrorTable/columns.tsx | 11 ++++++++--- src/pages/Gallery-N/ErrorTable/index.tsx | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pages/ErrorBook/ErrorRow.tsx b/src/pages/ErrorBook/ErrorRow.tsx index b7255f338f..2c2707c8c4 100644 --- a/src/pages/ErrorBook/ErrorRow.tsx +++ b/src/pages/ErrorBook/ErrorRow.tsx @@ -34,7 +34,7 @@ const ErrorRow: FC = ({ record, onDelete }) => { {word ? word.trans.join(';') : } - {record.wrongCount} + {record.wrongCount} {dictInfo?.name} Promise): ColumnD ) }, + cell: ({ row }) => { + return {row.original.errorCount} + }, }, { accessorKey: 'errorChar', header: '易错字母', - size: 80, + size: 100, cell: ({ row }) => { return (

{(row.getValue('errorChar') as string[]).map((char, index) => ( - {char + ' '} + + {char + ' '} + ))}

) @@ -59,7 +64,7 @@ export const errorColumns = (onDelete: (word: string) => Promise): ColumnD { accessorKey: 'delete', header: '', - size: 80, + size: 40, cell: ({ row }) => { return ( diff --git a/src/pages/Gallery-N/ErrorTable/index.tsx b/src/pages/Gallery-N/ErrorTable/index.tsx index 5a9ff82198..fc2aa97e25 100644 --- a/src/pages/Gallery-N/ErrorTable/index.tsx +++ b/src/pages/Gallery-N/ErrorTable/index.tsx @@ -75,7 +75,7 @@ export function ErrorTable({ data, isLoading, error, onDelete }: DataTableProps) )) ) : ( - + {isLoading ? : error ? '好像遇到错误啦!尝试刷新下' : '暂无数据, 快去练习吧!'}