Skip to content

Commit

Permalink
Open appstore or playstore on try it click (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin authored Nov 22, 2024
2 parents 3e1f5a9 + 5c813dd commit a05792b
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
@@ -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 (
<div className="bg-gray-100 transition-colors duration-300 dark:bg-gray-900">
<div className="container mx-auto p-4">
@@ -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" />

0 comments on commit a05792b

Please sign in to comment.