diff --git a/src/components/ConversationCard/ConversationCard.jsx b/src/components/ConversationCard/ConversationCard.jsx index afd0ffd..89213ad 100644 --- a/src/components/ConversationCard/ConversationCard.jsx +++ b/src/components/ConversationCard/ConversationCard.jsx @@ -4,9 +4,11 @@ import { useState, useEffect } from "react"; import styles from "./styles.module.css"; import MessageBox from "../messageBox/MessageBox"; import Skeleton from "@mui/material/Skeleton"; +import FileSharingModal from "../modals/FileSharingModal"; const ConversationCards = ({ loading }) => { const [text, settext] = useState(""); + const [showModal,setShowModal] = useState(false); const changeSelectedText = (markup) => { const textarea = document.getElementById("textAreaConversationCard"); @@ -92,6 +94,8 @@ const ConversationCards = ({ loading }) => { }); return ( + <> + { showModal && }
{ >
+ {/* Open modal here */} { height="30" rx="15" fill="#571F6A" + onClick={()=>setShowModal(true)} /> {
+ ); }; export default ConversationCards; diff --git a/src/components/modals/FileSharingModal.jsx b/src/components/modals/FileSharingModal.jsx new file mode 100644 index 0000000..1326a80 --- /dev/null +++ b/src/components/modals/FileSharingModal.jsx @@ -0,0 +1,141 @@ +import React, { useState } from 'react' + +function getRandomColor() { + const letters = "0123456789ABCDEF"; + let color = "#"; + for (let i = 0; i < 6; i++) { + color += letters[Math.floor(Math.random() * 16)]; + } + return color; + } + + +const Attachment = ({file, setFile}) => +{ + return ( +
+ + +
+ ) +} + +const AddTag = ({setTagFlag, setTags}) => +{ + const [tag,setTag] = useState(""); + const clickHandler = () => + { + setTags(prev=>[...prev,{tag,color:getRandomColor()}]); + setTagFlag(false); + } + return ( + + ) +} + +const Tags = ({tags,setTags}) => +{ + return ( + + + ) +} + +const FileSharingModal = ({setShowModal}) => { + const [name,setName] = useState(""); + const [file,setFile] = useState(""); + const [tagFlag,setTagFlag] = useState(false); + const [tags,setTags] = useState([]); + const [path,setPath] = useState(""); + + const isDisabled = () => name==="" || file==="" || tags.length===0 || path==="" + + const clickHandler = () => + { + // Enter function to handle share file click + } + + return ( +
+
+ setShowModal(false)} xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"> + + +

Share a File

+ + + + + + + + + +
+
+ ) +} + +export default FileSharingModal \ No newline at end of file