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.

fix dimensions

Steven Teyb01e388a5837
diff --git a/apps/web/ui/analytics/bar-list.tsx b/apps/web/ui/analytics/bar-list.tsx
index bca707edd4..d7773c5f19 100644
--- a/apps/web/ui/analytics/bar-list.tsx
+++ b/apps/web/ui/analytics/bar-list.tsx
@@ -33,6 +33,7 @@ import {
} from "react";
import useSWR from "swr";
import LinkPreviewTooltip from "./link-preview";
+import LinkLogo from "../links/link-logo";
export default function BarList({
tab,
@@ -168,26 +169,17 @@ export function LineItem({
: getApexDomain(title);
return (
<div className="z-10 flex items-center space-x-2 px-2">
- {tab === "link" && apexDomain ? (
+ {tab === "link" ? (
data ? (
- <BlurImage
- src={`${GOOGLE_FAVICON_URL}${apexDomain}`}
- alt={apexDomain}
- className="h-5 w-5 rounded-full"
- width={20}
- height={20}
+ <LinkLogo
+ apexDomain={apexDomain}
+ className="h-5 w-5 sm:h-5 sm:w-5"
/>
) : (
<div className="h-5 w-5 animate-pulse rounded-full bg-gray-100" />
)
- ) : tab === "url" && apexDomain ? (
- <BlurImage
- src={`${GOOGLE_FAVICON_URL}${apexDomain}`}
- alt={apexDomain}
- className="h-5 w-5 rounded-full"
- width={20}
- height={20}
- />
+ ) : tab === "url" ? (
+ <LinkLogo apexDomain={apexDomain} className="h-5 w-5 sm:h-5 sm:w-5" />
) : (
icon
)}
diff --git a/apps/web/ui/links/link-logo.tsx b/apps/web/ui/links/link-logo.tsx
index fa68297021..83081fdc27 100644
--- a/apps/web/ui/links/link-logo.tsx
+++ b/apps/web/ui/links/link-logo.tsx
@@ -1,22 +1,29 @@
import { BlurImage } from "@dub/ui";
-import { GOOGLE_FAVICON_URL } from "@dub/utils";
+import { GOOGLE_FAVICON_URL, cn } from "@dub/utils";
import { Globe } from "lucide-react";
export default function LinkLogo({
apexDomain,
+ className,
}: {
apexDomain?: string | null;
+ className?: string;
}) {
return apexDomain ? (
<BlurImage
src={`${GOOGLE_FAVICON_URL}${apexDomain}`}
alt={apexDomain}
- className="h-8 w-8 rounded-full sm:h-10 sm:w-10"
+ className={cn("h-8 w-8 rounded-full sm:h-10 sm:w-10", className)}
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">
+ <div
+ className={cn(
+ "flex h-8 w-8 items-center justify-center rounded-full bg-gray-100 px-0 sm:h-10 sm:w-10",
+ className,
+ )}
+ >
<Globe className="h-4 w-4 text-gray-600 sm:h-5 sm:w-5" />
</div>
);