Refocus responsive layouts on compact desktop use
All checks were successful
Deploy Sokko G / deploy (push) Successful in 19s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 19s
This commit is contained in:
parent
96d058293d
commit
0ac1a0974e
27 changed files with 610 additions and 190 deletions
16
website/src/hooks/useMediaQuery.js
Normal file
16
website/src/hooks/useMediaQuery.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Rôle : expose l'état réactif d'une media query pour synchroniser comportement et mise en page.
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function useMediaQuery(query) {
|
||||
const [matches, setMatches] = useState(() => window.matchMedia(query).matches);
|
||||
|
||||
useEffect(() => {
|
||||
const mediaQuery = window.matchMedia(query);
|
||||
const update = () => setMatches(mediaQuery.matches);
|
||||
update();
|
||||
mediaQuery.addEventListener("change", update);
|
||||
return () => mediaQuery.removeEventListener("change", update);
|
||||
}, [query]);
|
||||
|
||||
return matches;
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ import { getCalendarAlertOffsets, getCurrentCalendarOccurrence, getNextCalendarA
|
|||
import { getCountdownTargetMs } from "../features/toolboxes/modules/timerUtils.js";
|
||||
import { moduleStorageKey } from "../features/toolboxes/storage/toolboxStorage.js";
|
||||
|
||||
function getVisibleToolboxIds(route, drawerGameId, links) {
|
||||
export function getVisibleToolboxIds(route, drawerGameId, links) {
|
||||
const visibleIds = new Set();
|
||||
const toolboxMatch = route.match(/^\/toolbox\/([^/]+)/);
|
||||
if (toolboxMatch?.[1]) visibleIds.add(toolboxMatch[1]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue