mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-27 15:22:56 +08:00
fix widget height
This commit is contained in:
parent
c9dea03864
commit
732208e84d
@ -15,10 +15,10 @@ interface GraphProps {
|
|||||||
setSelectedNode: (node: [string, string][]) => void;
|
setSelectedNode: (node: [string, string][]) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const StyledEditorWrapper = styled.div<{ isWidget: boolean }>`
|
const StyledEditorWrapper = styled.div`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: ${({ isWidget }) => (isWidget ? "100vh" : "calc(100vh - 36px)")};
|
height: calc(100vh - 36px);
|
||||||
background: ${({ theme }) => theme.BACKGROUND_SECONDARY};
|
background: ${({ theme }) => theme.BACKGROUND_SECONDARY};
|
||||||
background-image: ${({ theme }) =>
|
background-image: ${({ theme }) =>
|
||||||
`radial-gradient(#505050 0.5px, ${theme.BACKGROUND_SECONDARY} 0.5px)`};
|
`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 (input) input.blur();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
if (nodes.length > 8_000) return <ErrorView />;
|
if (nodes.length > 8_000) return <ErrorView />;
|
||||||
|
|
||||||
if (nodes.length > 1_000 && !isWidget) {
|
if (nodes.length > 1_000 && !isWidget) {
|
||||||
@ -106,7 +105,7 @@ const GraphComponent = ({ isWidget = false, openModal, setSelectedNode }: GraphP
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledEditorWrapper isWidget={isWidget} onContextMenu={e => e.preventDefault()}>
|
<StyledEditorWrapper onContextMenu={e => e.preventDefault()}>
|
||||||
<Loading message="Painting graph..." loading={loading} />
|
<Loading message="Painting graph..." loading={loading} />
|
||||||
<TransformWrapper
|
<TransformWrapper
|
||||||
maxScale={2}
|
maxScale={2}
|
||||||
|
@ -4,7 +4,7 @@ import { Graph } from "src/components/Graph";
|
|||||||
import { getChildrenEdges } from "src/utils/getChildrenEdges";
|
import { getChildrenEdges } from "src/utils/getChildrenEdges";
|
||||||
import { getOutgoers } from "src/utils/getOutgoers";
|
import { getOutgoers } from "src/utils/getOutgoers";
|
||||||
import { parser } from "src/utils/core/jsonParser";
|
import { parser } from "src/utils/core/jsonParser";
|
||||||
import create from "zustand";
|
import { create } from "zustand";
|
||||||
import useJson from "./useJson";
|
import useJson from "./useJson";
|
||||||
|
|
||||||
const initialStates = {
|
const initialStates = {
|
||||||
|
@ -5,7 +5,7 @@ import { defaultJson } from "src/constants/data";
|
|||||||
import { saveJson as saveJsonDB } from "src/services/db/json";
|
import { saveJson as saveJsonDB } from "src/services/db/json";
|
||||||
import useGraph from "src/store/useGraph";
|
import useGraph from "src/store/useGraph";
|
||||||
import { Json } from "src/typings/altogic";
|
import { Json } from "src/typings/altogic";
|
||||||
import create from "zustand";
|
import { create } from "zustand";
|
||||||
|
|
||||||
interface JsonActions {
|
interface JsonActions {
|
||||||
setJson: (json: string) => void;
|
setJson: (json: string) => void;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import create from "zustand";
|
import { create } from "zustand";
|
||||||
import useUser from "./useUser";
|
import useUser from "./useUser";
|
||||||
|
|
||||||
interface ModalActions {
|
interface ModalActions {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import create from "zustand";
|
import { create } from "zustand";
|
||||||
import { persist } from "zustand/middleware";
|
import { persist } from "zustand/middleware";
|
||||||
import useGraph from "./useGraph";
|
import useGraph from "./useGraph";
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { altogic } from "src/api/altogic";
|
import { altogic } from "src/api/altogic";
|
||||||
import { AltogicAuth, User } from "src/typings/altogic";
|
import { AltogicAuth, User } from "src/typings/altogic";
|
||||||
import create from "zustand";
|
import { create } from "zustand";
|
||||||
import useModal from "./useModal";
|
import useModal from "./useModal";
|
||||||
|
|
||||||
interface UserActions {
|
interface UserActions {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user