feat(dashboard): Regions domain (#6534)
**What** - Implements new Region domain design - Adds new SplitView component for managing adding nested relations in FocusModals, eg. adding countries to a region. - Adds new Combobox component for multi select fields in forms **medusajs/ui** - Fix styling of RadioGroup.Choicebox component CLOSES CORE-1650, CORE-1671
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
export const useMediaQuery = (query: string) => {
|
||||
const mediaQuery = window.matchMedia(query)
|
||||
const [matches, setMatches] = useState(mediaQuery.matches)
|
||||
|
||||
useEffect(() => {
|
||||
const handler = (e: MediaQueryListEvent) => setMatches(e.matches)
|
||||
mediaQuery.addEventListener("change", handler)
|
||||
return () => mediaQuery.removeEventListener("change", handler)
|
||||
}, [mediaQuery])
|
||||
|
||||
return matches
|
||||
}
|
||||
Reference in New Issue
Block a user