diff --git a/src/frontend/src/modals/codeAreaModal/index.tsx b/src/frontend/src/modals/codeAreaModal/index.tsx new file mode 100644 index 000000000..1d53cf134 --- /dev/null +++ b/src/frontend/src/modals/codeAreaModal/index.tsx @@ -0,0 +1,125 @@ +import { Dialog, Transition } from "@headlessui/react"; +import { XMarkIcon, CommandLineIcon } from "@heroicons/react/24/outline"; +import { Fragment, useContext, useRef, useState } from "react"; +import { PopUpContext } from "../../contexts/popUpContext"; +import CodeEditor from "@uiw/react-textarea-code-editor"; + +export default function CodeAreaModal({ + value, + setValue, +}: { + setValue: (value: string) => void; + value: string | string[]; +}) { + const [open, setOpen] = useState(true); + const [code, setCode] = useState(value); + const { closePopUp } = useContext(PopUpContext); + const ref = useRef(); + function setModalOpen(x: boolean) { + setOpen(x); + if (x === false) { + setTimeout(() => { + closePopUp(); + }, 300); + } + } + return ( + + + +
+ + +
+
+ + +
+ +
+
+
+
+
+
+ + Edit Code + +
+
+
+
+
+ {/* need to insert code editor */} + { + setCode(e.target.value); + setValue(e.target.value); + }} + language={"python"} + placeholder="please insert your code here" + className="w-full h-full overflow-auto scrollbar-hide" + /> + + {/*