Browse Source

add onArticleEdit

visuddhinanda 2 years ago
parent
commit
9abf1a6457
1 changed files with 7 additions and 0 deletions
  1. 7 0
      dashboard/src/components/article/TypeArticle.tsx

+ 7 - 0
dashboard/src/components/article/TypeArticle.tsx

@@ -14,6 +14,7 @@ interface IWidget {
   anthologyId?: string | null;
   active?: boolean;
   onArticleChange?: Function;
+  onArticleEdit?: Function;
   onFinal?: Function;
   onLoad?: Function;
   onAnthologySelect?: Function;
@@ -29,6 +30,7 @@ const TypeArticleWidget = ({
   onFinal,
   onLoad,
   onAnthologySelect,
+  onArticleEdit,
 }: IWidget) => {
   const [articleData, setArticleData] = useState<IArticleDataResponse>();
   const [edit, setEdit] = useState(false);
@@ -49,6 +51,11 @@ const TypeArticleWidget = ({
         <ArticleEdit
           anthologyId={anthologyId ? anthologyId : undefined}
           articleId={articleId}
+          onChange={(value: IArticleDataResponse) => {
+            if (typeof onArticleEdit !== "undefined") {
+              onArticleEdit(value);
+            }
+          }}
         />
       ) : (
         <TypeArticleReader