From 8a999034b32f0283e6fabe6e0af60864bae6a422 Mon Sep 17 00:00:00 2001 From: Kaibo Huang <99372604+KaiboHuang1@users.noreply.github.com> Date: Wed, 16 Jul 2025 22:55:45 -0400 Subject: [PATCH 1/2] mobile view initial UI --- frontend/src/app/Components/Overlay.tsx | 64 +++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/frontend/src/app/Components/Overlay.tsx b/frontend/src/app/Components/Overlay.tsx index 1162235..ed8f57d 100644 --- a/frontend/src/app/Components/Overlay.tsx +++ b/frontend/src/app/Components/Overlay.tsx @@ -8,7 +8,11 @@ import { LucidePlus, LucideSearch, LucideUpload, + LucideFilter, + LucideSlidersHorizontal, + LucideSunMedium, } from "lucide-react"; +import { FaPlug } from "react-icons/fa6"; interface OverlayProps { showPinOverlay: boolean; @@ -19,6 +23,17 @@ interface OverlayProps { const portOptions = ["Triple Peg", "Double Peg", "USB", "HDMI"]; const conditionOptions = ["New", "Worn", "Slightly Damaged", "Damaged"]; +function useIsMobile() { + const [isMobile, setIsMobile] = useState(false); + useEffect(() => { + const checkMobile = () => setIsMobile(window.innerWidth <= 768); + checkMobile(); + window.addEventListener("resize", checkMobile); + return () => window.removeEventListener("resize", checkMobile); + }, []); + return isMobile; +} + const AddOutlet: React.FC = ({ showPinOverlay, coords, @@ -32,6 +47,8 @@ const AddOutlet: React.FC = ({ const [selectedCondition, setSelectedCondition] = useState("New"); const [extraDetails, setExtraDetails] = useState(""); const [showSettings, setShowSettings] = useState(false); + const [searchValue, setSearchValue] = useState(""); + const isMobile = useIsMobile(); //if coordinates exist, will fill them in for address useEffect(() => { @@ -40,6 +57,53 @@ const AddOutlet: React.FC = ({ } }, [coords]); + if (isMobile) { + return ( + <> +
+
+
+ {searchValue === "" && ( + + )} + setSearchValue(e.target.value)} + className="bg-transparent outline-none text-white placeholder-white/60 w-full text-md" + /> +
+
+
+
+ +
+
+
+ + + +
+
+ + ); + } + return (
From 2087dd10c8a83cc9d4031711a7a0873e369c548f Mon Sep 17 00:00:00 2001 From: Kaibo Huang <99372604+KaiboHuang1@users.noreply.github.com> Date: Fri, 18 Jul 2025 12:15:26 -0400 Subject: [PATCH 2/2] mobile view --- frontend/src/app/Components/Overlay.tsx | 98 ++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/Components/Overlay.tsx b/frontend/src/app/Components/Overlay.tsx index ed8f57d..2ff34b1 100644 --- a/frontend/src/app/Components/Overlay.tsx +++ b/frontend/src/app/Components/Overlay.tsx @@ -11,6 +11,10 @@ import { LucideFilter, LucideSlidersHorizontal, LucideSunMedium, + LucideHome, + LucideBriefcase, + LucideGraduationCap, + LucideHistory, } from "lucide-react"; import { FaPlug } from "react-icons/fa6"; @@ -34,6 +38,21 @@ function useIsMobile() { return isMobile; } +const dummyRecents = [ + { + title: "University of Waterloo", + address: "University Avenue West, Waterloo, ON", + }, + { + title: "University of Waterloo", + address: "University Avenue West, Waterloo, ON", + }, + { + title: "University of Waterloo", + address: "University Avenue West, Waterloo, ON", + }, +]; + const AddOutlet: React.FC = ({ showPinOverlay, coords, @@ -48,6 +67,7 @@ const AddOutlet: React.FC = ({ const [extraDetails, setExtraDetails] = useState(""); const [showSettings, setShowSettings] = useState(false); const [searchValue, setSearchValue] = useState(""); + const [searchFocused, setSearchFocused] = useState(false); const isMobile = useIsMobile(); //if coordinates exist, will fill them in for address @@ -61,18 +81,74 @@ const AddOutlet: React.FC = ({ return ( <>
-
-
- {searchValue === "" && ( - +
+
+
+
+ {searchValue === "" && ( + + )} + setSearchFocused(true)} + onBlur={() => setSearchFocused(false)} + onChange={(e) => setSearchValue(e.target.value)} + className="bg-transparent outline-none text-white placeholder-white/60 w-full text-md" + /> +
+
+ {searchFocused && ( +
+ {/* Home, Work, School */} +
+
+ + + Home + +
+
+ + + Work + +
+
+ + + School + +
+
+
+ {/* Recent Searches */} + {dummyRecents.map((item, idx) => ( +
+ +
+
+ {item.title} +
+
+ {item.address} +
+
+
+ ))} +
)} - setSearchValue(e.target.value)} - className="bg-transparent outline-none text-white placeholder-white/60 w-full text-md" - />