diff --git a/src/pages/addItemPage/index.jsx b/src/pages/addItemPage/index.jsx new file mode 100644 index 0000000..0ac346c --- /dev/null +++ b/src/pages/addItemPage/index.jsx @@ -0,0 +1,161 @@ +import React, { useState, useRef } from "react"; +import { BiSolidDownArrow } from "react-icons/bi"; + +export default function Index() { + const clothes = "whatever"; + const place = "whatever"; + const [selectedPhotos, setSelectedPhotos] = useState([]); + const [deleteIndices, setDeleteIndices] = useState([]); + const fileInputRef = useRef(null); + + const handleFileChange = (e) => { + const files = e.target.files; + const photoURLs = [...selectedPhotos]; + + for (let i = 0; i < files.length; i++) { + const photoURL = URL.createObjectURL(files[i]); + photoURLs.push(photoURL); + } + + setSelectedPhotos(photoURLs); + }; + + const handleDelete = (index) => { + const updatedPhotos = [...selectedPhotos]; + updatedPhotos.splice(index, 1); + setSelectedPhotos(updatedPhotos); + setDeleteIndices([...deleteIndices, index]); + }; + + const handleUploadClick = () => { + fileInputRef.current.click(); + }; + + return ( +
+
+

+ Add an Item +

+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +