visuddhinanda 2 лет назад
Родитель
Сommit
a7c90e7b5c
1 измененных файлов с 15 добавлено и 13 удалено
  1. 15 13
      dashboard/src/components/article/TypeArticleReader.tsx

+ 15 - 13
dashboard/src/components/article/TypeArticleReader.tsx

@@ -16,9 +16,9 @@ import { ArticleMode, ArticleType } from "./Article";
 import "./article.css";
 import ArticleSkeleton from "./ArticleSkeleton";
 import ErrorResult from "../general/ErrorResult";
-import AnthologiesAtArticle from "./AnthologiesAtArticle";
 import NavigateButton from "./NavigateButton";
 import InteractiveArea from "../discussion/InteractiveArea";
+import TypeArticleReaderToolbar from "./TypeArticleReaderToolbar";
 
 interface IWidget {
   type?: ArticleType;
@@ -159,6 +159,10 @@ const TypeArticleReaderWidget = ({
     };
   }
 
+  const title = articleData?.title_text
+    ? articleData?.title_text
+    : articleData?.title;
+
   return (
     <div>
       {loading ? (
@@ -167,10 +171,17 @@ const TypeArticleReaderWidget = ({
         <ErrorResult code={errorCode} />
       ) : (
         <>
-          <AnthologiesAtArticle
+          <TypeArticleReaderToolbar
+            title={title}
             articleId={articleId}
             anthologyId={anthologyId}
-            onClick={(
+            role={articleData?.role}
+            onEdit={() => {
+              if (typeof onEdit !== "undefined") {
+                onEdit();
+              }
+            }}
+            onAnthologySelect={(
               id: string,
               e: React.MouseEvent<HTMLElement, MouseEvent>
             ) => {
@@ -181,11 +192,7 @@ const TypeArticleReaderWidget = ({
           />
           <ArticleView
             id={articleData?.uid}
-            title={
-              articleData?.title_text
-                ? articleData?.title_text
-                : articleData?.title
-            }
+            title={title}
             subTitle={articleData?.subtitle}
             summary={articleData?.summary}
             content={articleData ? articleData.content : ""}
@@ -216,11 +223,6 @@ const TypeArticleReaderWidget = ({
                 onArticleChange(newType, newArticleId, target);
               }
             }}
-            onEdit={() => {
-              if (typeof onEdit !== "undefined") {
-                onEdit();
-              }
-            }}
           />
           <Divider />
           {extra}