@@ -2,21 +2,27 @@ import { useState, useEffect } from "react";
22import { Monitor , Smartphone } from "lucide-react" ;
33import { useLocation } from "react-router-dom" ;
44
5- import { paths } from "@/routes" ;
5+ import { mobileResponsivePaths } from "@/routes" ;
6+ import useMediaQuery from "@/hooks/useMediaQuery" ;
7+
68
79const MobileInfoModal = ( ) => {
810 const location = useLocation ( ) ;
911 const [ isOpen , setIsOpen ] = useState ( false ) ;
1012 const [ dismissed , setDismissed ] = useState ( false ) ;
13+ const isMobile = useMediaQuery ( "max-width: 970px" ) ;
1114
1215 const handleContinue = ( ) => {
1316 setIsOpen ( false ) ;
1417 setDismissed ( true ) ;
1518 } ;
1619
1720 const checkScreenSize = ( ) => {
18- const isMobile = window . innerWidth < 970 ;
19- if ( paths . includes ( location . pathname ) && isMobile && ! dismissed ) {
21+ if (
22+ ! mobileResponsivePaths . includes ( location . pathname ) &&
23+ isMobile &&
24+ ! dismissed
25+ ) {
2026 setIsOpen ( true ) ;
2127 } else {
2228 setIsOpen ( false ) ;
@@ -48,22 +54,24 @@ const MobileInfoModal = () => {
4854
4955 return isOpen ? (
5056 < div className = "fixed inset-0 z-50 bg-black/60 flex items-center justify-center" >
51- < div className = "bg-[#374151] text-white p-6 rounded-2xl shadow-2xl w-full max-w-md mx-4 relative text-center" >
57+ < div className = "bg-[#374151] p-6 rounded-2xl shadow-2xl w-full max-w-md mx-4 relative text-center" >
5258 < div className = "flex flex-col items-center gap-4" >
5359 < div className = "bg-[#6366f1]/10 rounded-full p-4" >
5460 < Monitor className = "w-8 h-8 text-[#6366f1]" />
5561 </ div >
56- < h2 className = "text-xl font-semibold" > Best Viewed on Desktop</ h2 >
62+ < h2 className = "text-xl font-semibold text-white" >
63+ Best Viewed on Desktop
64+ </ h2 >
5765 < p className = "text-sm text-gray-300" >
5866 Dev.tools is best experienced on wider screens
5967 </ p >
6068
6169 < div className = "flex items-center justify-center gap-4 py-2" >
62- < div className = "flex flex-col items-center gap-1 opacity-50" >
70+ < div className = "flex flex-col items-center gap-1 opacity-50 text-white " >
6371 < Smartphone className = "w-6 h-6" />
6472 < span className = "text-xs" > Mobile</ span >
6573 </ div >
66- < div className = "text-2xl" > →</ div >
74+ < div className = "text-2xl text-white " > →</ div >
6775 < div className = "flex flex-col items-center gap-1 text-[#6366f1]" >
6876 < Monitor className = "w-6 h-6" />
6977 < span className = "text-xs" > Desktop</ span >
0 commit comments