mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
update to mantine 7
This commit is contained in:
4
commafeed-client/src/hooks/useColorScheme.ts
Normal file
4
commafeed-client/src/hooks/useColorScheme.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { useComputedColorScheme } from "@mantine/core"
|
||||
|
||||
// the color scheme to use to render components
|
||||
export const useColorScheme = () => useComputedColorScheme("light")
|
||||
@@ -1,7 +1,9 @@
|
||||
import { useMediaQuery } from "@mantine/hooks"
|
||||
import { Constants } from "app/constants"
|
||||
|
||||
export const useMobile = (breakpoint: string = Constants.layout.mobileBreakpoint) =>
|
||||
!useMediaQuery(`(min-width: ${breakpoint})`, undefined, {
|
||||
export const useMobile = (breakpoint: string | number = Constants.layout.mobileBreakpoint) => {
|
||||
const bp = typeof breakpoint === "number" ? `${breakpoint}px` : breakpoint
|
||||
return !useMediaQuery(`(min-width: ${bp})`, undefined, {
|
||||
getInitialValueInEffect: false,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user