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.

Various link-related UI changes and fixes

Snazzah3a540cc17cbf
diff --git a/apps/web/app/expired/page.tsx b/apps/web/app/expired/page.tsx
index 0367679e91..0aeacfa127 100644
--- a/apps/web/app/expired/page.tsx
+++ b/apps/web/app/expired/page.tsx
@@ -15,7 +15,7 @@ export default async function ExpiredPage() {
return (
<main className="flex min-h-screen flex-col justify-between">
<Nav />
- <div className="mx-2 my-10 flex max-w-md flex-col items-center space-y-5 px-2.5 text-center sm:mx-auto sm:max-w-lg sm:px-0 lg:mb-16">
+ <div className="mx-2 my-10 flex max-w-md flex-col items-center space-y-5 px-2.5 text-center sm:mx-auto sm:max-w-lg sm:px-0 lg:mb-16 z-10">
<div className="mx-auto flex h-20 w-20 items-center justify-center rounded-full border border-gray-300 bg-white/30">
<TimerOff className="h-6 w-6 text-gray-400" />
</div>
diff --git a/apps/web/app/inspect/[domain]/[key]/card.tsx b/apps/web/app/inspect/[domain]/[key]/card.tsx
index 9766eb6589..137e7cde6d 100644
--- a/apps/web/app/inspect/[domain]/[key]/card.tsx
+++ b/apps/web/app/inspect/[domain]/[key]/card.tsx
@@ -2,6 +2,7 @@ import { BlurImage, CopyButton } from "@dub/ui";
import { GOOGLE_FAVICON_URL, getApexDomain, linkConstructor } from "@dub/utils";
import Script from "next/script";
import ReportButton from "./report";
+import { Globe } from "lucide-react";
export default function LinkInspectorCard({
domain,
@@ -19,13 +20,19 @@ export default function LinkInspectorCard({
<Script src="https://tally.so/widgets/embed.js" strategy="lazyOnload" />
<div className="flex w-full items-center justify-between rounded-md border border-gray-300 bg-white p-3">
<div className="flex items-center space-x-3">
- <BlurImage
- src={`${GOOGLE_FAVICON_URL}${apexDomain}`}
- alt={apexDomain}
- className="pointer-events-none h-10 w-10 rounded-full"
- width={20}
- height={20}
- />
+ {apexDomain ? (
+ <BlurImage
+ src={`${GOOGLE_FAVICON_URL}${apexDomain}`}
+ alt={apexDomain}
+ className="pointer-events-none h-10 w-10 rounded-full"
+ width={20}
+ height={20}
+ />
+ ) : (
+ <div className="flex h-10 w-10 items-center justify-center rounded-full bg-gray-100">
+ <Globe className="h-5 w-5 text-gray-600" />
+ </div>
+ )}
<div>
<div className="flex items-center space-x-1 sm:space-x-2">
<a
diff --git a/apps/web/app/inspect/[domain]/[key]/page.tsx b/apps/web/app/inspect/[domain]/[key]/page.tsx
index 51856d4b25..7a6e037af8 100644
--- a/apps/web/app/inspect/[domain]/[key]/page.tsx
+++ b/apps/web/app/inspect/[domain]/[key]/page.tsx
@@ -63,7 +63,7 @@ export default async function InspectPage({
<>
<main className="flex min-h-screen flex-col justify-between">
<Nav />
- <div className="mx-2 my-10 flex max-w-md flex-col space-y-5 px-2.5 text-center sm:mx-auto sm:max-w-lg sm:px-0 lg:mb-16">
+ <div className="mx-2 my-10 flex max-w-md flex-col space-y-5 px-2.5 text-center sm:mx-auto sm:max-w-lg sm:px-0 lg:mb-16 z-10">
<h1 className="font-display text-5xl font-extrabold leading-[1.15] text-black sm:text-6xl sm:leading-[1.15]">
Link Inspector
</h1>
diff --git a/apps/web/ui/links/link-card.tsx b/apps/web/ui/links/link-card.tsx
index 1dad7c05c5..fe5ef5fdb0 100644
--- a/apps/web/ui/links/link-card.tsx
+++ b/apps/web/ui/links/link-card.tsx
@@ -45,6 +45,7 @@ import {
QrCode,
TimerOff,
Lock,
+ Globe,
} from "lucide-react";
import Link from "next/link";
import { useParams } from "next/navigation";
@@ -260,7 +261,7 @@ export default function LinkCard({
)}
</div>
</Tooltip>
- ) : (
+ ) : apexDomain ? (
<BlurImage
src={`${GOOGLE_FAVICON_URL}${apexDomain}`}
alt={apexDomain}
@@ -268,6 +269,10 @@ export default function LinkCard({
width={20}
height={20}
/>
+ ) : (
+ <div className="flex h-8 w-8 items-center justify-center rounded-full bg-gray-100 px-0 sm:h-10 sm:w-10">
+ <Globe className="h-4 w-4 text-gray-600 sm:h-5 sm:w-5" />
+ </div>
)}
{/*
Here, we're manually setting ml-* values because if we do space-x-* in the parent div,
diff --git a/apps/web/ui/modals/add-edit-link-modal/index.tsx b/apps/web/ui/modals/add-edit-link-modal/index.tsx
index 4d7ac9fbd1..104a2bf170 100644
--- a/apps/web/ui/modals/add-edit-link-modal/index.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/index.tsx
@@ -52,6 +52,7 @@ import Preview from "./preview";
import RewriteSection from "./rewrite-section";
import TagsSection from "./tags-section";
import UTMSection from "./utm-section";
+import { Globe } from "lucide-react";
function AddEditLinkModal({
showAddEditLinkModal,
@@ -213,15 +214,20 @@ function AddEditLinkModal({
// if the link is password protected, or if it's a new link and there's no URL yet, return the default Dub logo
// otherwise, get the favicon of the URL
const url = password || !debouncedUrl ? null : debouncedUrl || props?.url;
+ const apexDomain = url ? getApexDomain(url) : null;
- return url ? (
+ return url ? apexDomain ? (
<BlurImage
- src={`${GOOGLE_FAVICON_URL}${getApexDomain(url)}`}
+ src={`${GOOGLE_FAVICON_URL}${apexDomain}`}
alt="Logo"
className="h-10 w-10 rounded-full"
width={20}
height={20}
/>
+ ) : (
+ <div className="flex h-10 w-10 items-center justify-center rounded-full bg-gray-100">
+ <Globe className="h-5 w-5 text-gray-600" />
+ </div>
) : (
<Logo />
);
diff --git a/apps/web/ui/modals/add-edit-link-modal/preview.tsx b/apps/web/ui/modals/add-edit-link-modal/preview.tsx
index 735c64874f..d26bd97f74 100644
--- a/apps/web/ui/modals/add-edit-link-modal/preview.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/preview.tsx
@@ -97,6 +97,9 @@ export default function Preview({
</div>
)}
</div>
+ {hostname && (
+ <p className="mt-2 text-[0.8rem] text-[#606770]">From {hostname}</p>
+ )}
</div>
{/* Facebook */}