From 5c813dd3d8d711d5c4d9ee77e3c7b60792540f47 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Fri, 22 Nov 2024 10:33:20 +0530 Subject: [PATCH] open appstore or playstore on try it click --- frontend/src/app/apps/[id]/page.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/apps/[id]/page.tsx b/frontend/src/app/apps/[id]/page.tsx index 83811d3ed4..6246742824 100644 --- a/frontend/src/app/apps/[id]/page.tsx +++ b/frontend/src/app/apps/[id]/page.tsx @@ -26,6 +26,7 @@ import { Input } from '@/src/components/ui/input'; import { Label } from '@/src/components/ui/label'; import PaidAmountDialog from '@/src/components/dashboard/paidamount'; import { PluginStat, Plugin } from '../page'; +import { headers } from 'next/headers'; const COST_CONSTANT = 0.05; @@ -55,6 +56,16 @@ export default async function PluginDetailView({ params }: { params: { id: strin // } // }, [darkMode]); + const userAgent = headers().get('user-agent') || ''; + const isAndroid = /android/i.test(userAgent); + const isIOS = /iphone|ipad|ipod/i.test(userAgent); + + const link = isAndroid + ? 'https://play.google.com/store/apps/details?id=com.friend.ios' + : isIOS + ? 'https://apps.apple.com/us/app/friend-ai-wearable/id6502156163' + : 'https://omi.me'; + return (