Browse Source

lint code

AykutSarac 2 years ago
parent
commit
af51b43771

+ 3 - 4
src/components/Graph/index.tsx

@@ -1,4 +1,3 @@
-// @ts-nocheck
 import React from "react";
 import {
   ReactZoomPanPinchRef,
@@ -44,9 +43,9 @@ const StyledEditorWrapper = styled.div<{ isWidget: boolean }>`
 const GraphComponent = ({ isWidget, openModal, setSelectedNode }: LayoutProps) => {
   const setConfig = useConfig(state => state.setConfig);
   const setGraphValue = useGraph(state => state.setGraphValue);
+  const loading = useGraph(state => state.loading);
   const layout = useConfig(state => state.layout);
   const nodes = useGraph(state => state.nodes);
-  const loading = useGraph(state => state.loading);
   const edges = useGraph(state => state.edges);
 
   const [size, setSize] = React.useState({
@@ -88,7 +87,7 @@ const GraphComponent = ({ isWidget, openModal, setSelectedNode }: LayoutProps) =
     if (input) input.blur();
   }, []);
 
-  if (nodes.length > 5_000) return <ErrorView />;
+  if (nodes.length > 8_000) return <ErrorView />;
 
   return (
     <StyledEditorWrapper isWidget={isWidget}>
@@ -111,7 +110,7 @@ const GraphComponent = ({ isWidget, openModal, setSelectedNode }: LayoutProps) =
             width: "100%",
             height: "100%",
             overflow: "hidden",
-            display: loading ? "none" : "block"
+            display: loading ? "none" : "block",
           }}
         >
           <Canvas

+ 1 - 2
src/components/Loading/index.tsx

@@ -26,9 +26,8 @@ const StyledLoading = styled.div`
   background: ${({ theme }) => theme.BLACK_DARK};
   z-index: 36;
   pointer-events: none;
-  animation: 0.5s ${fadeIn};
+  animation: 0.2s ${fadeIn};
   animation-fill-mode: forwards;
-
   visibility: hidden;
 `;
 

+ 2 - 2
src/components/MonacoEditor/index.tsx

@@ -42,9 +42,9 @@ export const MonacoEditor = ({
   React.useEffect(() => {
     const { nodes, edges } = parser(json, expand);
 
+    setGraphValue("loading", true);
     setGraphValue("nodes", nodes);
     setGraphValue("edges", edges);
-    setGraphValue("loading", true);
     setValue(json);
   }, [expand, json, setGraphValue]);
 
@@ -65,7 +65,7 @@ export const MonacoEditor = ({
     }, 1200);
 
     return () => clearTimeout(formatTimer);
-  }, [value, setJson, setHasError, setGraphValue]);
+  }, [value, setJson, setHasError]);
 
   return (
     <StyledWrapper>