Selaa lähdekoodia

add TypeCourse

visuddhinanda 2 vuotta sitten
vanhempi
sitoutus
2b973b54d3
1 muutettua tiedostoa jossa 15 lisäystä ja 1 poistoa
  1. 15 1
      dashboard/src/components/article/Article.tsx

+ 15 - 1
dashboard/src/components/article/Article.tsx

@@ -7,6 +7,7 @@ import "./article.css";
 import TypePage from "./TypePage";
 import TypeCSPara from "./TypeCSPara";
 import { ISearchParams } from "../../pages/library/article/show";
+import TypeCourse from "./TypeCourse";
 
 export type ArticleMode = "read" | "edit" | "wbw";
 export type ArticleType =
@@ -48,7 +49,7 @@ interface IWidget {
   book?: string | null;
   para?: string | null;
   anthologyId?: string | null;
-  courseId?: string;
+  courseId?: string | null;
   exerciseId?: string;
   userName?: string;
   active?: boolean;
@@ -187,6 +188,19 @@ const ArticleWidget = ({
             }
           }}
         />
+      ) : type === "textbook" ? (
+        <TypeCourse
+          type={type}
+          articleId={articleId}
+          channelId={channelId}
+          courseId={courseId}
+          mode={mode}
+          onArticleChange={(type: ArticleType, id: string, target: string) => {
+            if (typeof onArticleChange !== "undefined") {
+              onArticleChange(type, id, target);
+            }
+          }}
+        />
       ) : (
         <></>
       )}