From 732208e84dcbb77edf85343a30d67d3077252802 Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Tue, 24 Jan 2023 21:47:18 +0300 Subject: [PATCH] fix widget height --- src/components/Graph/index.tsx | 7 +++---- src/store/useGraph.tsx | 2 +- src/store/useJson.tsx | 2 +- src/store/useModal.tsx | 2 +- src/store/useStored.tsx | 2 +- src/store/useUser.tsx | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/Graph/index.tsx b/src/components/Graph/index.tsx index 433a4ff..9ec3bfb 100644 --- a/src/components/Graph/index.tsx +++ b/src/components/Graph/index.tsx @@ -15,10 +15,10 @@ interface GraphProps { setSelectedNode: (node: [string, string][]) => void; } -const StyledEditorWrapper = styled.div<{ isWidget: boolean }>` +const StyledEditorWrapper = styled.div` position: absolute; width: 100%; - height: ${({ isWidget }) => (isWidget ? "100vh" : "calc(100vh - 36px)")}; + height: calc(100vh - 36px); background: ${({ theme }) => theme.BACKGROUND_SECONDARY}; background-image: ${({ theme }) => `radial-gradient(#505050 0.5px, ${theme.BACKGROUND_SECONDARY} 0.5px)`}; @@ -98,7 +98,6 @@ const GraphComponent = ({ isWidget = false, openModal, setSelectedNode }: GraphP if (input) input.blur(); }, []); - if (nodes.length > 8_000) return ; if (nodes.length > 1_000 && !isWidget) { @@ -106,7 +105,7 @@ const GraphComponent = ({ isWidget = false, openModal, setSelectedNode }: GraphP } return ( - e.preventDefault()}> + e.preventDefault()}> void; diff --git a/src/store/useModal.tsx b/src/store/useModal.tsx index ef01b4d..ad81956 100644 --- a/src/store/useModal.tsx +++ b/src/store/useModal.tsx @@ -1,4 +1,4 @@ -import create from "zustand"; +import { create } from "zustand"; import useUser from "./useUser"; interface ModalActions { diff --git a/src/store/useStored.tsx b/src/store/useStored.tsx index 55031ac..c8eca48 100644 --- a/src/store/useStored.tsx +++ b/src/store/useStored.tsx @@ -1,4 +1,4 @@ -import create from "zustand"; +import { create } from "zustand"; import { persist } from "zustand/middleware"; import useGraph from "./useGraph"; diff --git a/src/store/useUser.tsx b/src/store/useUser.tsx index 7f5fa9f..62b4893 100644 --- a/src/store/useUser.tsx +++ b/src/store/useUser.tsx @@ -1,7 +1,7 @@ import toast from "react-hot-toast"; import { altogic } from "src/api/altogic"; import { AltogicAuth, User } from "src/typings/altogic"; -import create from "zustand"; +import { create } from "zustand"; import useModal from "./useModal"; interface UserActions {