From e1acb3747d96ba8db3ae321a5dff51d7c6ed71dc Mon Sep 17 00:00:00 2001 From: naheyansheikh Date: Thu, 5 Dec 2024 19:20:23 -0800 Subject: [PATCH] Accidentally removed multiple file uploads in the preview section. Fixed some minor css styling. --- .../Home/LeftSection/RecentActivityCard.css | 4 +--- .../components/Home/LeftSection/ShopBooksCard.css | 2 +- frontend/src/components/Home/MainContent.css | 4 ++-- .../components/Home/RightSection/ProgressItem.css | 14 +++++++------- .../components/Home/RightSection/ProgressItem.jsx | 8 ++++---- frontend/src/pages/upload_photo/UploadPhoto.jsx | 7 +------ 6 files changed, 16 insertions(+), 23 deletions(-) diff --git a/frontend/src/components/Home/LeftSection/RecentActivityCard.css b/frontend/src/components/Home/LeftSection/RecentActivityCard.css index 692ecea8..004c1920 100644 --- a/frontend/src/components/Home/LeftSection/RecentActivityCard.css +++ b/frontend/src/components/Home/LeftSection/RecentActivityCard.css @@ -3,8 +3,7 @@ border-radius: 30px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); padding: 20px; - height: 83%; - max-height: 300px; + min-height: 32%; overflow-y: auto; transition: transform 0.2s ease; } @@ -36,7 +35,6 @@ .activity-list { display: flex; flex-direction: column; - margin-top: -10px; } .activity-item { diff --git a/frontend/src/components/Home/LeftSection/ShopBooksCard.css b/frontend/src/components/Home/LeftSection/ShopBooksCard.css index f22af55d..3861ebba 100644 --- a/frontend/src/components/Home/LeftSection/ShopBooksCard.css +++ b/frontend/src/components/Home/LeftSection/ShopBooksCard.css @@ -6,7 +6,7 @@ display: flex; justify-content: space-between; cursor: pointer; - height: 83%; + height: 32%; position: relative; overflow: hidden; transition: transform 0.2s ease; diff --git a/frontend/src/components/Home/MainContent.css b/frontend/src/components/Home/MainContent.css index 7135a91e..83521deb 100644 --- a/frontend/src/components/Home/MainContent.css +++ b/frontend/src/components/Home/MainContent.css @@ -9,7 +9,7 @@ display: grid; grid-template-columns: 1fr 1fr; gap: 30px; - margin-top: 30px; + margin-top: 25px; width: 95%; - height: calc(500px - 280px - 24px); + height: 100%; } diff --git a/frontend/src/components/Home/RightSection/ProgressItem.css b/frontend/src/components/Home/RightSection/ProgressItem.css index bd00ac29..58820943 100644 --- a/frontend/src/components/Home/RightSection/ProgressItem.css +++ b/frontend/src/components/Home/RightSection/ProgressItem.css @@ -1,4 +1,4 @@ -.progress-item { +.logbook-progress-item { width: 100%; padding: 12px; border-radius: 8px; @@ -7,33 +7,33 @@ background-color: transparent; } -.progress-item:hover { +.logbook-progress-item:hover { background-color: #e7edf8; } -.progress-item:hover .progress-bar { +.logbook-progress-item:hover .logbook-progress-bar { background: #fbfcfe; } -.progress-item:hover .progress-info { +.logbook-progress-item:hover .logbook-progress-info { color: #244b94; } -.progress-info { +.logbook-progress-info { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 15px; } -.progress-bar { +.logbook-progress-bar { height: 8px; background: #e7edf8; border-radius: 4px; overflow: hidden; } -.progress-fill { +.logbook-progress-fill { height: 100%; background: #244b94; border-radius: 4px; diff --git a/frontend/src/components/Home/RightSection/ProgressItem.jsx b/frontend/src/components/Home/RightSection/ProgressItem.jsx index 1a67a04c..99187798 100644 --- a/frontend/src/components/Home/RightSection/ProgressItem.jsx +++ b/frontend/src/components/Home/RightSection/ProgressItem.jsx @@ -2,14 +2,14 @@ import "./ProgressItem.css"; export default function ProgressItem({ item, onClick }) { return ( -
-
+
+
{item.name} {item.progress}%
-
+
diff --git a/frontend/src/pages/upload_photo/UploadPhoto.jsx b/frontend/src/pages/upload_photo/UploadPhoto.jsx index 1f1b93db..d0d0ccb1 100644 --- a/frontend/src/pages/upload_photo/UploadPhoto.jsx +++ b/frontend/src/pages/upload_photo/UploadPhoto.jsx @@ -65,21 +65,16 @@ function MainContent({ files, setFiles, handleTranscribe }) { /** Handle files from input or drop */ const handleFiles = (newFiles) => { - console.log("Received files:", newFiles); // Debug log - const filesArray = Array.from(newFiles); - console.log("Files array:", filesArray); // Debug log const filesWithPreview = filesArray.map((file) => { - console.log("Processing file:", file); // Debug log return { file: file, // Store the actual File object timestamp: Date.now(), preview: URL.createObjectURL(file), }; }); - - setFiles(filesWithPreview); + setFiles((prev) => [...filesWithPreview, ...prev]); // Add new files to beginning }; /** Toggle preview visibility */