소스 검색

add onArticleEdit

visuddhinanda 2 년 전
부모
커밋
782e577ef4
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      dashboard/src/components/article/Article.tsx

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

@@ -61,6 +61,7 @@ interface IWidget {
   onLoad?: Function;
   onAnthologySelect?: Function;
   onTitle?: Function;
+  onArticleEdit?: Function;
 }
 const ArticleWidget = ({
   type,
@@ -80,6 +81,7 @@ const ArticleWidget = ({
   onLoad,
   onAnthologySelect,
   onTitle,
+  onArticleEdit,
 }: IWidget) => {
   const [currId, setCurrId] = useState(articleId);
   useEffect(() => setCurrId(articleId), [articleId]);
@@ -94,6 +96,11 @@ const ArticleWidget = ({
           mode={mode}
           anthologyId={anthologyId}
           active={active}
+          onArticleEdit={(value: IArticleDataResponse) => {
+            if (typeof onArticleEdit !== "undefined") {
+              onArticleEdit(value);
+            }
+          }}
           onArticleChange={(type: ArticleType, id: string, target: string) => {
             if (typeof onArticleChange !== "undefined") {
               onArticleChange(type, id, target);