mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-21 18:55:16 +02:00
Merge pull request #1413 from mvanhorn/fix/1359-shared-isMobile-hook
fix: use shared useIsMobile (768px) in SidebarSlideOutPanel (#1359)
This commit is contained in:
commit
4774105015
1 changed files with 2 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import { AnimatePresence, motion } from "motion/react";
|
import { AnimatePresence, motion } from "motion/react";
|
||||||
import { useCallback, useEffect } from "react";
|
import { useCallback, useEffect } from "react";
|
||||||
import { useMediaQuery } from "@/hooks/use-media-query";
|
import { useIsMobile } from "@/hooks/use-mobile";
|
||||||
import { SLIDEOUT_PANEL_OPENED_EVENT } from "@/lib/layout-events";
|
import { SLIDEOUT_PANEL_OPENED_EVENT } from "@/lib/layout-events";
|
||||||
|
|
||||||
interface SidebarSlideOutPanelProps {
|
interface SidebarSlideOutPanelProps {
|
||||||
|
|
@ -28,7 +28,7 @@ export function SidebarSlideOutPanel({
|
||||||
width = 360,
|
width = 360,
|
||||||
children,
|
children,
|
||||||
}: SidebarSlideOutPanelProps) {
|
}: SidebarSlideOutPanelProps) {
|
||||||
const isMobile = !useMediaQuery("(min-width: 640px)");
|
const isMobile = useIsMobile();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (open) {
|
if (open) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue