| @@ -2,8 +2,11 @@ | ||
| 2 | 2 | import { isInTheFuture } from '@wordpress/date'; |
| 3 | 3 | import { create } from 'zustand'; |
| 4 | 4 | import { devtools, persist } from 'zustand/middleware'; |
| 5 | 5 | |
| 6 | +// Mirrors Tailwind's --breakpoint-md, where WP's admin bar goes big. | |
| 7 | +export const DESKTOP_MIN_WIDTH = 783; | |
| 8 | + | |
| 6 | 9 | const url = new URL(window.location.href); |
| 7 | 10 | const openAgentFromUrl = url.searchParams.has('extendify-open-agent'); |
| 8 | 11 | if (openAgentFromUrl) { |
| 9 | 12 | url.searchParams.delete('extendify-open-agent'); |
| @@ -21,9 +24,9 @@ | ||
| 21 | 24 | // e.g. floating, docked-left, docked-right ? |
| 22 | 25 | mode: window.extAgentData?.agentPosition, |
| 23 | 26 | queuedTour: null, |
| 24 | 27 | scratch: {}, |
| 25 | - isMobile: window.innerWidth < 768, | |
| 28 | + isMobile: window.innerWidth < DESKTOP_MIN_WIDTH, | |
| 26 | 29 | setIsMobile: (isMobile) => { |
| 27 | 30 | if (get().isMobile === isMobile) return; |
| 28 | 31 | set({ isMobile }); |
| 29 | 32 | }, |