Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Improve Custom Link Preview

Steven Teyc85599f1c713
diff --git a/apps/web/ui/modals/link-builder/link-preview.tsx b/apps/web/ui/modals/link-builder/link-preview.tsx
index 296c755bf8..291cd59292 100644
--- a/apps/web/ui/modals/link-builder/link-preview.tsx
+++ b/apps/web/ui/modals/link-builder/link-preview.tsx
@@ -5,6 +5,7 @@ import {
Icon,
ShimmerDots,
SimpleTooltipContent,
+ Switch,
useKeyboardShortcut,
useMediaQuery,
} from "@dub/ui";
@@ -95,7 +96,9 @@ export function LinkPreview() {
<OGModal />
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
- <h2 className="text-sm font-medium text-gray-700">Link Preview</h2>
+ <h2 className="text-sm font-medium text-gray-700">
+ Custom Link Preview
+ </h2>
<ProBadgeTooltip
content={
<SimpleTooltipContent
@@ -106,14 +109,9 @@ export function LinkPreview() {
}
/>
</div>
- <Button
- type="button"
- variant="outline"
- icon={
- <Pen2 className={cn("mx-px size-4", proxy && "text-blue-500")} />
- }
- className="h-7 w-fit px-1"
- onClick={() => setShowOGModal(true)}
+ <Switch
+ checked={proxy}
+ fn={() => setValue("proxy", !proxy, { shouldDirty: true })}
/>
</div>
<div className="mt-2.5 grid grid-cols-4 gap-2">
@@ -138,7 +136,14 @@ export function LinkPreview() {
);
})}
</div>
- <div className="mt-2">
+ <div className="relative mt-2">
+ <Button
+ type="button"
+ variant="secondary"
+ icon={<Pen2 className="mx-px size-4" />}
+ className="absolute right-2 top-2 z-10 h-8 w-fit px-1.5"
+ onClick={() => setShowOGModal(true)}
+ />
<OGPreview
title={title}
description={description}
diff --git a/apps/web/ui/modals/link-builder/qr-code-preview.tsx b/apps/web/ui/modals/link-builder/qr-code-preview.tsx
index f8862788c4..6f145643c2 100644
--- a/apps/web/ui/modals/link-builder/qr-code-preview.tsx
+++ b/apps/web/ui/modals/link-builder/qr-code-preview.tsx
@@ -1,9 +1,11 @@
import useDomain from "@/lib/swr/use-domain";
import useWorkspace from "@/lib/swr/use-workspace";
+import { ProBadgeTooltip } from "@/ui/shared/pro-badge-tooltip";
import { QRCode } from "@/ui/shared/qr-code";
import {
Button,
ShimmerDots,
+ SimpleTooltipContent,
useInViewport,
useKeyboardShortcut,
useLocalStorage,
@@ -74,19 +76,30 @@ export function QRCodePreview() {
<div ref={ref}>
<LinkQRModal />
<div className="flex items-center justify-between">
- <h2 className="text-sm font-medium text-gray-700">QR Code</h2>
+ <div className="flex items-center gap-2">
+ <h2 className="text-sm font-medium text-gray-700">QR Code</h2>
+ <ProBadgeTooltip
+ content={
+ <SimpleTooltipContent
+ title="Set a custom QR code design to improve click-through rates."
+ cta="Learn more."
+ href="https://dub.co/help/article/custom-qr-codes"
+ />
+ }
+ />
+ </div>
+ </div>
+ <div className="relative mt-2 h-24 overflow-hidden rounded-md border border-gray-300">
<Button
type="button"
- variant="outline"
+ variant="secondary"
icon={<Pen2 className="mx-px size-4" />}
- className="h-7 w-fit px-1"
+ className="absolute right-2 top-2 z-10 h-8 w-fit bg-white px-1.5"
onClick={() => setShowLinkQRModal(true)}
disabledTooltip={
key && domain ? undefined : "Enter a short link to customize"
}
/>
- </div>
- <div className="relative mt-2 h-24 overflow-hidden rounded-md border border-gray-300">
{!isMobile && (
<ShimmerDots className="opacity-30 [mask-image:radial-gradient(40%_80%,transparent_50%,black)]" />
)}