Bladeren bron

add hideNav

visuddhinanda 2 jaren geleden
bovenliggende
commit
40ca45fc86
1 gewijzigde bestanden met toevoegingen van 22 en 16 verwijderingen
  1. 22 16
      dashboard/src/components/article/TypePali.tsx

+ 22 - 16
dashboard/src/components/article/TypePali.tsx

@@ -25,6 +25,7 @@ interface IWidget {
   para?: string | null;
   active?: boolean;
   focus?: string | null;
+  hideNav?: boolean;
   onArticleChange?: Function;
   onFinal?: Function;
   onLoad?: Function;
@@ -37,6 +38,7 @@ const TypePaliWidget = ({
   articleId,
   mode = "read",
   active = true,
+  hideNav = false,
   focus,
   onArticleChange,
   onFinal,
@@ -270,22 +272,26 @@ const TypePaliWidget = ({
           <Divider />
           {extra}
           <Divider />
-          <Navigate
-            type={type as ArticleType}
-            articleId={articleId}
-            onChange={(
-              event: React.MouseEvent<HTMLElement, MouseEvent>,
-              newId: string
-            ) => {
-              let target: string = "_self";
-              if (event.ctrlKey || event.metaKey) {
-                target = "_blank";
-              }
-              if (typeof onArticleChange !== "undefined") {
-                onArticleChange(type, newId, target);
-              }
-            }}
-          />
+          {hideNav ? (
+            <></>
+          ) : (
+            <Navigate
+              type={type as ArticleType}
+              articleId={articleId}
+              onChange={(
+                event: React.MouseEvent<HTMLElement, MouseEvent>,
+                newId: string
+              ) => {
+                let target: string = "_self";
+                if (event.ctrlKey || event.metaKey) {
+                  target = "_blank";
+                }
+                if (typeof onArticleChange !== "undefined") {
+                  onArticleChange(type, newId, target);
+                }
+              }}
+            />
+          )}
         </>
       )}
     </div>