Skip to content

Commit f7d87c3

Browse files
committed
improve deeplink interstitial page
1 parent 86e9688 commit f7d87c3

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ export function DeepLinkActionButtons({ link }: { link: EdgeLinkProps }) {
1111
copyToClipboard(link.shortLink);
1212
}
1313

14-
window.location.href = link.ios || link.url;
14+
window.location.href = link.shortLink;
1515
};
1616

1717
return (
1818
<div className="flex flex-col items-center gap-4">
1919
<Button
20-
text="Get the App"
20+
text="Open in the app"
2121
className="h-12 w-full rounded-xl bg-neutral-900 text-white"
2222
variant="primary"
2323
onClick={() => handleClick({ withCopy: true })}
@@ -28,7 +28,7 @@ export function DeepLinkActionButtons({ link }: { link: EdgeLinkProps }) {
2828
onClick={() => handleClick()}
2929
className="text-sm text-neutral-500"
3030
>
31-
Get the App without copying
31+
Open in the app without copying
3232
</button>
3333
</div>
3434
);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"use client";
2+
3+
import { EdgeLinkProps } from "@/lib/planetscale";
4+
import { useCopyToClipboard } from "@dub/ui";
5+
import { getApexDomain, GOOGLE_FAVICON_URL } from "@dub/utils";
6+
7+
export function BrandLogoBadge({ link }: { link: EdgeLinkProps }) {
8+
const [_copied, copyToClipboard] = useCopyToClipboard();
9+
10+
return (
11+
<button
12+
onClick={() => {
13+
copyToClipboard(link.shortLink);
14+
window.location.href = link.shortLink;
15+
}}
16+
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"
17+
>
18+
<img
19+
src={`${GOOGLE_FAVICON_URL}${getApexDomain(link.url)}`}
20+
className="size-8 shrink-0 overflow-visible rounded-full p-px"
21+
/>
22+
<div className="pr-1.5 text-lg font-semibold text-neutral-900">
23+
{getApexDomain(link.url)}
24+
</div>
25+
</button>
26+
);
27+
}

apps/web/app/deeplink/[domain]/[key]/page.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { getLinkViaEdge } from "@/lib/planetscale";
22
import { Grid, Wordmark } from "@dub/ui";
33
import { ArrowRight, Copy, IOSAppStore, MobilePhone } from "@dub/ui/icons";
4-
import { cn, getApexDomain, GOOGLE_FAVICON_URL } from "@dub/utils";
4+
import { cn } from "@dub/utils";
55
import Link from "next/link";
66
import { notFound } from "next/navigation";
77
import { DeepLinkActionButtons } from "./action-buttons";
8+
import { BrandLogoBadge } from "./brand-logo-badge";
89

910
export const runtime = "edge";
1011

@@ -72,20 +73,11 @@ export default async function DeepLinkPage({
7273

7374
<div className="flex flex-1 flex-col justify-center gap-12">
7475
<div className="flex flex-col items-center gap-y-6">
75-
<div className="inline-flex items-center gap-2 rounded-full bg-white p-1.5 shadow-lg shadow-black/10 ring-1 ring-neutral-200">
76-
<img
77-
src={`${GOOGLE_FAVICON_URL}${getApexDomain(link.url)}`}
78-
className="size-8 shrink-0 overflow-visible rounded-full p-px"
79-
/>
80-
<div className="pr-1.5 text-lg font-semibold text-neutral-900">
81-
{getApexDomain(link.url)}
82-
</div>
83-
</div>
76+
<BrandLogoBadge link={link} />
8477

8578
<div className="flex h-40 w-full max-w-xs flex-col gap-6 rounded-xl border border-neutral-300 px-10 py-8">
8679
<p className="text-center text-sm font-normal leading-5 text-neutral-700">
87-
Clicking below will copy this page and open it after you install
88-
the app.
80+
Clicking below will copy this page and open it in the app.
8981
</p>
9082

9183
<div className="flex items-center justify-center gap-3">

0 commit comments

Comments
 (0)