Skip to content

Commit ea17ddf

Browse files
committed
use a href instead of button
1 parent f7d87c3 commit ea17ddf

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

apps/web/app/deeplink/[domain]/[key]/action-buttons.tsx

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,21 @@ import { Button, IOSAppStore, useCopyToClipboard } from "@dub/ui";
66
export function DeepLinkActionButtons({ link }: { link: EdgeLinkProps }) {
77
const [_copied, copyToClipboard] = useCopyToClipboard();
88

9-
const handleClick = async ({ withCopy }: { withCopy?: boolean } = {}) => {
10-
if (withCopy) {
11-
copyToClipboard(link.shortLink);
12-
}
13-
14-
window.location.href = link.shortLink;
15-
};
16-
179
return (
1810
<div className="flex flex-col items-center gap-4">
19-
<Button
20-
text="Open in the app"
21-
className="h-12 w-full rounded-xl bg-neutral-900 text-white"
22-
variant="primary"
23-
onClick={() => handleClick({ withCopy: true })}
24-
icon={<IOSAppStore className="size-6" />}
25-
/>
11+
<a href={link.shortLink} className="w-full">
12+
<Button
13+
text="Open in the app"
14+
className="h-12 w-full rounded-xl bg-neutral-900 text-white"
15+
variant="primary"
16+
onClick={() => copyToClipboard(link.shortLink)}
17+
icon={<IOSAppStore className="size-6" />}
18+
/>
19+
</a>
2620

27-
<button
28-
onClick={() => handleClick()}
29-
className="text-sm text-neutral-500"
30-
>
21+
<a href={link.shortLink} className="text-sm text-neutral-500">
3122
Open in the app without copying
32-
</button>
23+
</a>
3324
</div>
3425
);
3526
}

apps/web/app/deeplink/[domain]/[key]/brand-logo-badge.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ export function BrandLogoBadge({ link }: { link: EdgeLinkProps }) {
88
const [_copied, copyToClipboard] = useCopyToClipboard();
99

1010
return (
11-
<button
12-
onClick={() => {
13-
copyToClipboard(link.shortLink);
14-
window.location.href = link.shortLink;
15-
}}
11+
<a
12+
onClick={() => copyToClipboard(link.shortLink)}
13+
href={link.shortLink}
1614
className="inline-flex items-center gap-2 rounded-full bg-white px-3 py-1.5 shadow-lg shadow-black/10 ring-1 ring-neutral-200"
1715
>
1816
<img
@@ -22,6 +20,6 @@ export function BrandLogoBadge({ link }: { link: EdgeLinkProps }) {
2220
<div className="pr-1.5 text-lg font-semibold text-neutral-900">
2321
{getApexDomain(link.url)}
2422
</div>
25-
</button>
23+
</a>
2624
);
2725
}

0 commit comments

Comments
 (0)