Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix: day details on mobile not showing

Salman Abuhaimedbb9c0c9b686a
diff --git a/client/src/pages/TripPlannerPage.tsx b/client/src/pages/TripPlannerPage.tsx
index 7636a86ce..5e4816732 100644
--- a/client/src/pages/TripPlannerPage.tsx
+++ b/client/src/pages/TripPlannerPage.tsx
@@ -98,6 +98,14 @@ export default function TripPlannerPage(): React.ReactElement | null {
const [mobileSidebarOpen, setMobileSidebarOpen] = useState<'left' | 'right' | null>(null)
const [deletePlaceId, setDeletePlaceId] = useState<number | null>(null)
+ const [isMobile, setIsMobile] = useState(() => window.innerWidth < 768)
+ useEffect(() => {
+ const mq = window.matchMedia('(max-width: 767px)')
+ const handler = (e: MediaQueryListEvent) => setIsMobile(e.matches)
+ mq.addEventListener('change', handler)
+ return () => mq.removeEventListener('change', handler)
+ }, [])
+
// Load trip + files (needed for place inspector file section)
useEffect(() => {
if (tripId) {
@@ -544,8 +552,8 @@ export default function TripPlannerPage(): React.ReactElement | null {
lng={geoPlace?.lng}
onClose={() => setShowDayDetail(null)}
onAccommodationChange={loadAccommodations}
- leftWidth={leftCollapsed ? 0 : leftWidth}
- rightWidth={rightCollapsed ? 0 : rightWidth}
+ leftWidth={isMobile ? 0 : (leftCollapsed ? 0 : leftWidth)}
+ rightWidth={isMobile ? 0 : (rightCollapsed ? 0 : rightWidth)}
/>
)
})()}