diff --git a/apps/desktop/layer/renderer/src/modules/download/index.tsx b/apps/desktop/layer/renderer/src/modules/download/index.tsx
index b6328a85b..c072fd59c 100644
--- a/apps/desktop/layer/renderer/src/modules/download/index.tsx
+++ b/apps/desktop/layer/renderer/src/modules/download/index.tsx
@@ -1,12 +1,32 @@
import { Folo } from "@follow/components/icons/folo.jsx"
import { Logo } from "@follow/components/icons/logo.jsx"
import { Button } from "@follow/components/ui/button/index.js"
+import { APP_STORE_URLS } from "@follow/constants"
+import { getMobilePlatform, isMobileDevice } from "@follow/utils"
+import { useEffect } from "react"
export function DownloadPage() {
const openDownloadPage = () => {
window.open("https://folo.is/download", "_blank", "noopener,noreferrer")
}
+ const mobilePlatform = getMobilePlatform()
+ const isMobile = isMobileDevice()
+
+ useEffect(() => {
+ if (isMobile && mobilePlatform && APP_STORE_URLS[mobilePlatform]) {
+ window.location.href = APP_STORE_URLS[mobilePlatform]
+ }
+ }, [isMobile, mobilePlatform])
+
+ const handleMobileDownload = () => {
+ if (mobilePlatform && APP_STORE_URLS[mobilePlatform]) {
+ window.location.href = APP_STORE_URLS[mobilePlatform]
+ } else {
+ openDownloadPage()
+ }
+ }
+
return (
{/* Logo Section */}
@@ -22,18 +42,30 @@ export function DownloadPage() {
Download Folo
-
Get the mobile app for the best experience
+
+ {isMobile
+ ? mobilePlatform
+ ? `Get the ${mobilePlatform} app for the best experience`
+ : "Get the mobile app for the best experience"
+ : "Get the mobile app for the best experience"}
+
{/* Download Button */}
-
+
- Go to Download Page
+
+ {isMobile && mobilePlatform ? `Download for ${mobilePlatform}` : "Go to Download Page"}
+
{/* Hint */}
- Available for iOS, Android, Windows, macOS & Linux
+ {isMobile
+ ? mobilePlatform
+ ? `Redirecting to ${mobilePlatform === "iOS" ? "App Store" : "Google Play"}...`
+ : "Available for iOS, Android, Windows, macOS & Linux"
+ : "Available for iOS, Android, Windows, macOS & Linux"}
diff --git a/packages/internal/constants/src/app.ts b/packages/internal/constants/src/app.ts
index 7d1e37ead..f049921e9 100644
--- a/packages/internal/constants/src/app.ts
+++ b/packages/internal/constants/src/app.ts
@@ -1 +1,7 @@
export const APPLE_APP_STORE_ID = "6739802604"
+export const GOOGLE_PLAY_PACKAGE_ID = "is.follow"
+
+export const APP_STORE_URLS = {
+ iOS: `https://apps.apple.com/us/app/folo-follow-everything/id${APPLE_APP_STORE_ID}`,
+ Android: `https://play.google.com/store/apps/details?id=${GOOGLE_PLAY_PACKAGE_ID}`,
+} as const
diff --git a/packages/internal/utils/src/utils.ts b/packages/internal/utils/src/utils.ts
index 49901ac07..6a396f2df 100644
--- a/packages/internal/utils/src/utils.ts
+++ b/packages/internal/utils/src/utils.ts
@@ -476,3 +476,15 @@ export function formatNumber(num: number): string {
return `${isNegative ? "-" : ""}${absNum}`
}
+
+export type MobilePlatform = "iOS" | "Android" | null
+
+export const getMobilePlatform = once((): MobilePlatform => {
+ const os = getOS()
+
+ return ["iOS", "Android"].includes(os) ? (os as MobilePlatform) : null
+})
+
+export const isMobileDevice = once((): boolean => {
+ return getMobilePlatform() !== null
+})