diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 287d3a068..a35f14452 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -10,6 +10,8 @@ import { typesContext } from "../../contexts/typesContext"; import { useContext, useRef } from "react"; import { NodeDataType } from "../../types/flow"; import { alertContext } from "../../contexts/alertContext"; +import { PopUpContext } from "../../contexts/popUpContext"; +import NodeModal from "../../modals/NodeModal"; export default function GenericNode({ data, @@ -21,6 +23,7 @@ export default function GenericNode({ const { setErrorData } = useContext(alertContext); const showError = useRef(true); const { types, deleteNode } = useContext(typesContext); + const {openPopUp} = useContext(PopUpContext) const Icon = nodeIcons[types[data.type]]; if (!Icon) { if (showError.current) { @@ -124,7 +127,16 @@ export default function GenericNode({ )} > {" "} - +
Output diff --git a/src/frontend/src/contexts/index.tsx b/src/frontend/src/contexts/index.tsx index 310606ea5..783bd108c 100644 --- a/src/frontend/src/contexts/index.tsx +++ b/src/frontend/src/contexts/index.tsx @@ -12,15 +12,13 @@ export default function ContextWrapper({ children }: { children: ReactNode }) { <> - - - - - {children} - - - - + + + + {children} + + + diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx new file mode 100644 index 000000000..2d0476d8d --- /dev/null +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -0,0 +1,113 @@ +import { Dialog, Transition } from "@headlessui/react"; +import { + XMarkIcon, +} from "@heroicons/react/24/outline"; +import { Fragment, useContext, useRef, useState } from "react"; +import { PopUpContext } from "../../contexts/popUpContext"; +import { NodeDataType } from "../../types/flow"; +import { nodeColors, nodeIcons } from "../../utils"; +import { typesContext } from "../../contexts/typesContext"; + +export default function NodeModal({ data }: { data: NodeDataType }) { + const [open, setOpen] = useState(true); + const { closePopUp } = useContext(PopUpContext); + const { types } = useContext(typesContext); + const ref = useRef(); + function setModalOpen(x: boolean) { + setOpen(x); + if (x === false) { + setTimeout(() => { + closePopUp(); + }, 300); + } + } + const Icon = nodeIcons[types[data.type]]; + return ( + + + +
+ + +
+
+ + +
+ +
+
+
+ +
+ + Edit text + +
+
+
+
+
+
content
+
+
+
+
+ +
+
+
+
+
+
+
+
+ ); +}