From 0dde4dab725faae2ac32b84ffd0d1274fe68c10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CAkshola00=E2=80=9D?= <“akinniyishola07@gmail.com”> Date: Tue, 17 Dec 2024 08:13:39 +0100 Subject: [PATCH 01/10] feat: implemetn restrict mobile --- frontend/src/App.jsx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 3a600107..8f2061d2 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -24,6 +24,9 @@ function App() { const [tgUser, setTgUser] = useState(JSON.parse(localStorage.getItem('tg_user'))); const [showModal, setShowModal] = useState(false); const navigate = useNavigate(); + const [isMobile, setIsMobile] = useState(false); + const [showPopup, setShowPopup] = useState(false); + const connectWalletMutation = useConnectWallet(setWalletId); useEffect(() => { @@ -69,6 +72,34 @@ function App() { const closeModal = () => { setShowModal(false); }; + + useEffect(() => { + const checkMobile = () => { + const userAgent = navigator.userAgent || navigator.vendor || window.opera; + + const mobileRegex = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i; + + const isMobileDevice = mobileRegex.test(userAgent); + setIsMobile(isMobileDevice); + + const isMobileWidth = window.innerWidth <= 768; + setIsMobile(isMobileDevice || isMobileWidth); + }; + + checkMobile(); + + window.addEventListener('resize', checkMobile); + + return () => window.removeEventListener('resize', checkMobile); + }, []); + + + const handleWebSiteAccess = () => { + if (isMobile) { + setShowPopup(true); + } + + }; return (
@@ -109,6 +140,10 @@ function App() {
); } From ce31c1180b307f01049e6c60918cee2c7072f89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CAkshola00=E2=80=9D?= <“akinniyishola07@gmail.com”> Date: Tue, 17 Dec 2024 08:14:18 +0100 Subject: [PATCH 02/10] feat fix --- frontend/src/App.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 8f2061d2..ff2f8eba 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -141,7 +141,7 @@ function App() {