feat: implement full flight history tracking and enhance trail rendering (#11)
* feat: implement full flight history tracking and enhance trail rendering * feat: enhance flight tracking logic and improve path handling * feat: implement airline logo caching and error handling in flight components * feat: enhance flight tracking logic to improve waypoint handling and connection logic * feat: refactor longitude handling and improve flight tracking logic * feat: improve longitude handling and enhance airline logo failure tracking
This commit is contained in:
@ -18,8 +18,17 @@ export function MapAttribution({ styleId }: MapAttributionProps) {
|
||||
|
||||
const toggle = useCallback(() => setExpanded((prev) => !prev), []);
|
||||
|
||||
// Expand by default on larger screens (after mount to avoid hydration mismatch)
|
||||
useEffect(() => {
|
||||
setExpanded(window.innerWidth >= SM_BREAKPOINT);
|
||||
const mq = window.matchMedia(`(min-width: ${SM_BREAKPOINT}px)`);
|
||||
const sync = () => setExpanded(mq.matches);
|
||||
const raf = window.requestAnimationFrame(sync);
|
||||
|
||||
mq.addEventListener("change", sync);
|
||||
return () => {
|
||||
window.cancelAnimationFrame(raf);
|
||||
mq.removeEventListener("change", sync);
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Close on outside click for small screens
|
||||
|
||||
Reference in New Issue
Block a user