Tweak useIsDesktop
This commit is contained in:
parent
cdc59fab9d
commit
8df8981b6c
@ -5,7 +5,7 @@ export default function useIsDesktop() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
const breakpointMd = getComputedStyle(document.documentElement)
|
const breakpointMd = getComputedStyle(document.body)
|
||||||
.getPropertyValue('--breakpoint-md');
|
.getPropertyValue('--breakpoint-md');
|
||||||
const mql = window.matchMedia(`(min-width: ${breakpointMd})`);
|
const mql = window.matchMedia(`(min-width: ${breakpointMd})`);
|
||||||
setIsDesktop(mql.matches);
|
setIsDesktop(mql.matches);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user