mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 02:34:21 +00:00
fix(client): a phone turned sideways stays in the phone layout
The phone shell was chosen by width alone, and most phones are wider than 767px in landscape, so turning one swapped the whole route tree for the desktop planner and an open sheet, its input and the map position were lost. The phone query now also covers a touch screen under 500px tall, which no tablet is. It lives in one place: the shell, the planner and todo hooks, the warnings banner, dialog focus and the stylesheets read it, and six components that measured the window once on mount now follow it.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React from 'react'
|
||||
import { Footprints, MoveRight, type LucideIcon } from 'lucide-react'
|
||||
import { useIsPhone } from '../../mobile/useIsPhone'
|
||||
|
||||
/**
|
||||
* Shared display bits for public-transit entries (#1065) — the timeline row,
|
||||
@@ -33,7 +34,7 @@ export function TransitWalkDivider({ leg, t, size = 'md' }: {
|
||||
size?: 'sm' | 'md'
|
||||
}) {
|
||||
const mins = leg.duration ? Math.round(leg.duration / 60) : null
|
||||
const isMobile = typeof window !== 'undefined' && window.innerWidth < 768
|
||||
const isMobile = useIsPhone()
|
||||
// Hairlines that fade towards the outer edges — strongest next to the text.
|
||||
const rule = (dir: 'left' | 'right'): React.CSSProperties => ({
|
||||
flex: 1, height: 1, minWidth: 12, borderRadius: 1,
|
||||
|
||||
Reference in New Issue
Block a user