diff --git a/CHANGELOG.md b/CHANGELOG.md index a78a53f..0a2ea04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## 2024-04-03 - 修复了因部分作业缺少动作列表而渲染失败的问题 +- 修复了点击作业(集)卡片上的按钮时会跳转到详情页的问题 +- 修复了作业集编辑器的保存按钮失效的问题 +- 优化了一些界面布局 ## 2024-04-01 diff --git a/src/components/OperationCard.tsx b/src/components/OperationCard.tsx index 45345c6..8c8b290 100644 --- a/src/components/OperationCard.tsx +++ b/src/components/OperationCard.tsx @@ -1,6 +1,7 @@ import { Button, Card, Elevation, H4, H5, Icon, Tag } from '@blueprintjs/core' import { Tooltip2 } from '@blueprintjs/popover2' +import clsx from 'clsx' import { handleCopyShortCode, handleDownloadJSON } from 'services/operation' import { ReLink } from 'components/ReLink' @@ -19,22 +20,21 @@ export const NeoOperationCard = ({ operation }: { operation: Operation }) => { const { data: levels } = useLevels() return ( - - + +
-

+

{operation.parsedContent.doc.title}

-
@@ -105,8 +105,10 @@ export const NeoOperationCard = ({ operation }: { operation: Operation }) => {
-
-
+ + + + ) } @@ -114,11 +116,12 @@ export const OperationCard = ({ operation }: { operation: Operation }) => { const { data: levels } = useLevels() return ( - - +
{/* title */}
@@ -126,7 +129,6 @@ export const OperationCard = ({ operation }: { operation: Operation }) => {

{operation.parsedContent.doc.title}

-
{
-
+
{/* meta */} -
-
-
- - +
+
+ + +
+ + +
+ + {operation.views}
+
- -
- - {operation.views} -
-
+
+ + +
+
- - + + {operation.uploader}
-
-
- -
- - {operation.uploader} -
-
-
+
- {/*
作业描述
*/} {
- - + + + + ) } @@ -230,16 +233,15 @@ const OperatorTags = ({ operation }: { operation: Operation }) => { ) } -const CardActions = ({ operation }: { operation: Operation }) => { +const CardActions = ({ + className, + operation, +}: { + className?: string + operation: Operation +}) => { return ( - // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -
{ - // 避免点击按钮时触发卡片的链接跳转 - e.stopPropagation() - }} - > +
{
-
+
- - + + + + ) } @@ -91,11 +84,15 @@ export const OperationSetCard = ({ operationSet: OperationSetListItem }) => { return ( - - +
{/* title */}
@@ -103,65 +100,73 @@ export const OperationSetCard = ({

{operationSet.name}

- - 复制神秘代码 -
- } - > -
-
+
{/* meta */} -
-
-
- - {operationSet.copilotIds.length}份作业 +
+
+ + {operationSet.copilotIds.length}份作业 - - -
-
-
- -
- - {operationSet.creator} -
-
+ +
+ +
+ + {operationSet.creator} +
+
- {/*
作业描述
*/}
- - + + + + + ) +} + +const CardActions = ({ + className, + operationSet, +}: { + className?: string + operationSet: OperationSetListItem +}) => { + return ( +
+ 复制神秘代码
+ } + > +
) } diff --git a/src/components/operation-set/AddToOperationSet.tsx b/src/components/operation-set/AddToOperationSet.tsx index fe840c9..0eeb202 100644 --- a/src/components/operation-set/AddToOperationSet.tsx +++ b/src/components/operation-set/AddToOperationSet.tsx @@ -33,14 +33,7 @@ export function AddToOperationSetButton({ return ( <> -