diff --git a/src/components/ipfs-upload/dropzone.tsx b/src/components/ipfs-upload/dropzone.tsx index 0fb8b9d990..1cad1c88bc 100644 --- a/src/components/ipfs-upload/dropzone.tsx +++ b/src/components/ipfs-upload/dropzone.tsx @@ -31,12 +31,14 @@ import { FiExternalLink, FiTrash2, FiUploadCloud } from "react-icons/fi"; import { Button, Card, + Checkbox, Heading, Text, TrackedCopyButton, TrackedIconButton, TrackedLink, } from "tw-components"; +import { Label } from "../../@/components/ui/label"; const TRACKING_CATEGORY = "ipfs_uploader"; @@ -142,7 +144,12 @@ const FileUpload: React.FC = ({ files, updateFiles }) => { progress: 0, total: 100, }); + const [uploadWithoutDirectory, setUploadWithoutDirectory] = useState( + files.length === 1, + ); + const uploadToAFolder = !uploadWithoutDirectory; const storageUpload = useStorageUpload({ + uploadWithoutDirectory, onProgress: setProgress, metadata: { address, @@ -369,62 +376,85 @@ const FileUpload: React.FC = ({ files, updateFiles }) => { align="center" gap={{ base: 2, md: 8 }} flexShrink={0} - p={{ base: 0, md: 2 }} + p={{ base: 2, md: 2 }} pt={2} bg="bgWhite" + justifyContent={"space-between"} > - - + setUploadWithoutDirectory(!e.target.checked)} + /> + + + )} + {storageUpload.isLoading && ( + -
- 50 && progress.progress !== progress.total - ? "black" - : "white", - }} - _light={{ - color: - progressPercent > 50 && progress.progress !== progress.total - ? "white" - : "black", - }} - willChange="color" - transition="color 0.2s" + +
- {Math.round(progressPercent)}% - -
- - + 50 && + progress.progress !== progress.total + ? "black" + : "white", + }} + _light={{ + color: + progressPercent > 50 && + progress.progress !== progress.total + ? "white" + : "black", + }} + willChange="color" + transition="color 0.2s" + > + {Math.round(progressPercent)}% + +
+
+ )} +