diff --git a/src/app/student/map/_components/MainView.tsx b/src/app/student/map/_components/MainView.tsx index 2d8a1d9..a46c244 100644 --- a/src/app/student/map/_components/MainView.tsx +++ b/src/app/student/map/_components/MainView.tsx @@ -1,3 +1,32 @@ +"use client" + +import { MapComponent } from "@/app/student/map/_components/MapComponent" +import Sidebar from "@/app/student/map/_components/Sidebar" +import { useState } from "react" +import { BoothMap } from "../lib/booths" +import { LocationId, locations, Location } from "../lib/locations" +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue +} from "@/components/ui/select" +import { Exhibitor } from "@/components/shared/hooks/api/useExhibitors" + +export default function MainView({ boothMap, exhibitors }: { boothMap: BoothMap, exhibitors: Exhibitor[] }) { + const [locationId, setLocationId] = useState("nymble/1") + const location = locations.find(loc => loc.id === locationId)! + + return ( +
+ + + +
+ ) +} + function SelectLocation({ locationId, setLocationId diff --git a/src/app/student/map/_components/Sidebar.tsx b/src/app/student/map/_components/Sidebar.tsx new file mode 100644 index 0000000..fd74c41 --- /dev/null +++ b/src/app/student/map/_components/Sidebar.tsx @@ -0,0 +1,76 @@ +"use client" + +import { cn } from "@/lib/utils" +import { useScreenSize } from "@/components/shared/hooks/useScreenSize" +import { Exhibitor } from "@/components/shared/hooks/api/useExhibitors" +import { Drawer, DrawerContent } from "@/components/ui/drawer" +import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area" +import { useState } from "react" +import { Button } from "@/components/ui/button" + +export default function Sidebar({ exhibitors }: { exhibitors: Exhibitor[] }) { + const { width } = useScreenSize() + const isMobile = width ? width <= 640 : false + + return ( + + + + ) +} + +function SidebarContainer({ + isMobile, + children +}: { + isMobile: boolean + children: React.ReactNode +}) { + const [open, setOpen] = useState(true) + + if (!open) { + return ( + + ) + } + + return ( + { + setOpen(open) + }} + direction={isMobile ? "bottom" : "left"}> + + + {children} + + + + + ) +} diff --git a/src/components/ui/drawer.tsx b/src/components/ui/drawer.tsx index 4ffe0b1..adb722c 100644 --- a/src/components/ui/drawer.tsx +++ b/src/components/ui/drawer.tsx @@ -37,18 +37,22 @@ DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName const DrawerContent = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( + React.ComponentPropsWithoutRef & { + withHandle?: boolean + } +>(({ className, children, withHandle = true, ...props }, ref) => ( -
+ {withHandle && ( +
+ )}
{children}