Ver Fonte

add onLoad

visuddhinanda há 2 anos atrás
pai
commit
cb647cd269
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      dashboard/src/components/article/Article.tsx

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

@@ -67,6 +67,7 @@ interface IWidgetArticle {
   active?: boolean;
   active?: boolean;
   onArticleChange?: Function;
   onArticleChange?: Function;
   onFinal?: Function;
   onFinal?: Function;
+  onLoad?: Function;
 }
 }
 const ArticleWidget = ({
 const ArticleWidget = ({
   type,
   type,
@@ -83,6 +84,7 @@ const ArticleWidget = ({
   active = false,
   active = false,
   onArticleChange,
   onArticleChange,
   onFinal,
   onFinal,
+  onLoad,
 }: IWidgetArticle) => {
 }: IWidgetArticle) => {
   const [articleData, setArticleData] = useState<IArticleDataResponse>();
   const [articleData, setArticleData] = useState<IArticleDataResponse>();
 
 
@@ -256,6 +258,10 @@ const ArticleWidget = ({
               default:
               default:
                 break;
                 break;
             }
             }
+
+            if (typeof onLoad !== "undefined") {
+              onLoad(json.data);
+            }
           } else {
           } else {
             setShowSkeleton(false);
             setShowSkeleton(false);
             setUnauthorized(true);
             setUnauthorized(true);