diff --git a/src/views/ManageList.jsx b/src/views/ManageList.jsx index 6222b23..f4490a3 100644 --- a/src/views/ManageList.jsx +++ b/src/views/ManageList.jsx @@ -1,15 +1,16 @@ import { useState, useMemo } from 'react'; -import { addItem, shareList } from '../api/firebase'; +import { addItem } from '../api/firebase'; import { FaPlusSquare } from 'react-icons/fa'; import { IconButton } from '../components/IconButton'; -import { FaEnvelope } from 'react-icons/fa6'; +import { Share } from './Share'; export function ManageList({ listPath, user, data }) { const currentUserId = user?.uid; const [itemName, setItemName] = useState(''); const [daysUntilNextPurchase, setDaysUntilNextPurchase] = useState(7); const [message, setMessage] = useState(''); - const [recipientEmail, setRecipientEmail] = useState(''); + + const [isModalDialogOpen, setIsModalDialogOpen] = useState(false); const messages = { added: 'Your item was successfully added!', @@ -59,18 +60,6 @@ export function ManageList({ listPath, user, data }) { } }; - const handleShare = (event) => { - event.preventDefault(); - shareList(listPath, currentUserId, recipientEmail) - .then((result) => { - alert(result); - setRecipientEmail(''); - }) - .catch((error) => { - alert(error); - }); - }; - return (