diff --git a/components/pages/home/GlobeView.tsx b/components/pages/home/GlobeView.tsx index e7832a9..c87f391 100644 --- a/components/pages/home/GlobeView.tsx +++ b/components/pages/home/GlobeView.tsx @@ -415,7 +415,7 @@ export function GlobeView() { We are from worldwide
- Our ethnic diersity is our strength. Our students are from all over the world. We are a global team. + Our ethnic dievrsity is our strength. We are from all over the world. We are a global team.
diff --git a/components/pwa-install.jsx b/components/pwa-install.jsx new file mode 100644 index 0000000..ac99a29 --- /dev/null +++ b/components/pwa-install.jsx @@ -0,0 +1,86 @@ +// @ts-nocheck +"use client"; +import { useEffect, useState } from "react"; + +import { Button } from "@/components/ui/button"; +const PwaInstall = () => { + const [deferredPrompt, setDeferredPrompt] = useState(null); + + useEffect(() => { + const handleBeforeInstallPrompt = (event) => { + // Prevent the default installation prompt + event.preventDefault(); + // Store the event for later use + setDeferredPrompt(event); + }; + + // Listen for the beforeinstallprompt event + window.addEventListener("beforeinstallprompt", handleBeforeInstallPrompt); + // warn the user if the app is already installed + + // Cleanup: remove the event listener when the component is unmounted + return () => { + window.removeEventListener( + "beforeinstallprompt", + handleBeforeInstallPrompt, + ); + }; + }, []); + const handleEmailOpen = (event) => { + event.preventDefault(); + window.location.href = "mailto:rinattok21@gmail.com"; + + }; + const handleInstallClick = (event) => { + event.preventDefault(); + + // Display confirmation alert to install from the user + // if ( + // window.confirm( + // "The app is still in development stage. Some devices might face flickering issues. Please use the website for better experience. Click OK to continue." + // ) + // ) { + if (deferredPrompt) { + // Show the installation prompt + deferredPrompt.prompt(); + + // Wait for the user to respond to the prompt + deferredPrompt.userChoice.then((choiceResult) => { + if (choiceResult.outcome === "accepted") { + console.log("User accepted the installation"); + } else { + console.log("User dismissed the installation"); + } + + // Reset the deferredPrompt variable + setDeferredPrompt(null); + }); + } + // } + }; + + return ( +- {title || `Build with Aceternity UI`} + Let's stay connected
{description || - `Scroll this component and see the bottom SVG come to life wow this - works!`} + `Install the app on your device for an optimal experience. You can also contact us via email.`}
-