Skip to content

Commit

Permalink
open appstore or playstore on try it click
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmohsin7 committed Nov 22, 2024
1 parent 440c93f commit 5c813dd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion frontend/src/app/apps/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 (
<div className="bg-gray-100 transition-colors duration-300 dark:bg-gray-900">
<div className="container mx-auto p-4">
Expand Down Expand Up @@ -167,7 +178,9 @@ export default async function PluginDetailView({ params }: { params: { id: strin
{/*<PaidAmountDialog plugin={plugin} />*/}
</div>
<Button className="w-full bg-black text-white hover:bg-gray-800" asChild>
<Link href={`https://omi.me`}>Try it</Link>
<Link href={link}>
Try it
</Link>
</Button>
<div className="mb-2 flex items-center">
<Star className="mr-2 h-6 w-6 text-yellow-400" />
Expand Down

0 comments on commit 5c813dd

Please sign in to comment.