Quellcode durchsuchen

学员discussion 显示shortcut图标

visuddhinanda vor 1 Jahr
Ursprung
Commit
7f75f14a9b
1 geänderte Dateien mit 21 neuen und 14 gelöschten Zeilen
  1. 21 14
      dashboard/src/components/discussion/DiscussionListCard.tsx

+ 21 - 14
dashboard/src/components/discussion/DiscussionListCard.tsx

@@ -12,7 +12,11 @@ import User from "../auth/User";
 import { IArticleListResponse } from "../api/Article";
 import { useAppSelector } from "../../hooks";
 import { currentUser as _currentUser } from "../../reducers/current-user";
-import { CommentOutlinedIcon, TemplateOutlinedIcon } from "../../assets/icon";
+import {
+  CommentOutlinedIcon,
+  ShortcutIcon,
+  TemplateOutlinedIcon,
+} from "../../assets/icon";
 import { ISentenceResponse } from "../api/Corpus";
 import { TDiscussionType } from "./Discussion";
 import { courseInfo, memberInfo } from "../../reducers/current-course";
@@ -103,19 +107,22 @@ const DiscussionListCardWidget = ({
           title: {
             render(dom, entity, index, action, schema) {
               return (
-                <Button
-                  key={index}
-                  size="small"
-                  type="link"
-                  icon={entity.newTpl ? <TemplateOutlinedIcon /> : undefined}
-                  onClick={(event) => {
-                    if (typeof onSelect !== "undefined") {
-                      onSelect(event, entity);
-                    }
-                  }}
-                >
-                  {entity.title}
-                </Button>
+                <>
+                  {entity.resId !== resId ? <ShortcutIcon /> : <></>}
+                  <Button
+                    key={index}
+                    size="small"
+                    type="link"
+                    icon={entity.newTpl ? <TemplateOutlinedIcon /> : undefined}
+                    onClick={(event) => {
+                      if (typeof onSelect !== "undefined") {
+                        onSelect(event, entity);
+                      }
+                    }}
+                  >
+                    {entity.title}
+                  </Button>
+                </>
               );
             },
           },