diff --git a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx new file mode 100644 index 000000000..f1841caba --- /dev/null +++ b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx @@ -0,0 +1,34 @@ +import { Transition } from "@headlessui/react"; +import { Bars3CenterLeftIcon } from "@heroicons/react/24/outline"; +import { nodeColors } from "../../../utils"; + +export default function ChatTrigger({open, setOpen}){ + return( + + + { + setOpen(true); + }} + > + + + Chat + + + + + ) +} \ No newline at end of file diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 11516f004..6393df55b 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -19,6 +19,7 @@ import { TabsContext } from "../../contexts/tabsContext"; import { ChatType } from "../../types/chat"; import ChatMessage from "./chatMessage"; import { NodeType } from "../../types/flow"; +import ChatTrigger from "./chatTrigger"; const _ = require("lodash"); @@ -258,34 +259,7 @@ export default function Chat({ flow, reactFlowInstance }: ChatType) { - - - - { - setOpen(true); - }} - > - - - Chat - - - - - + > ); } diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx new file mode 100644 index 000000000..93e4ed3d4 --- /dev/null +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -0,0 +1,102 @@ +import { Dialog, Transition } from "@headlessui/react"; +import { XMarkIcon, ClipboardDocumentListIcon } from "@heroicons/react/24/outline"; +import { Fragment, useContext, useRef, useState } from "react"; +import { PopUpContext } from "../../contexts/popUpContext"; + +export default function TextAreaModal(){ + const [open, setOpen] = useState(true); + const { closePopUp } = useContext(PopUpContext); + const ref = useRef(); + function setModalOpen(x:boolean){ + setOpen(x); + if(x === false){ + setTimeout(() => {closePopUp()}, 300); + } + } + return ( + + + + + + + + + + + + { + setModalOpen(false); + }} + > + Close + + + + + + + + + + + Edit text + + + + + + + + + + + { + setModalOpen(false); + }} + > + Finish editing + + + + + + + + + + ) +} \ No newline at end of file