Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Enhance OutboundLinksList component with favicon display and layout adjustments

Bill Yangaa7ae3f3db36
diff --git a/client/src/app/[site]/events/components/OutboundLinksList.tsx b/client/src/app/[site]/events/components/OutboundLinksList.tsx
index 5587461c9..fcb0309b4 100644
--- a/client/src/app/[site]/events/components/OutboundLinksList.tsx
+++ b/client/src/app/[site]/events/components/OutboundLinksList.tsx
@@ -6,6 +6,7 @@ import { DateTime } from "luxon";
import { memo } from "react";
import { OutboundLink } from "../../../../api/analytics/events/useGetOutboundLinks";
import { cn } from "../../../../lib/utils";
+import { Favicon } from "../../../../components/Favicon";
// Skeleton component for OutboundLinksList
const OutboundLinksListSkeleton = memo(({ size = "small" }: { size?: "small" | "large" }) => {
@@ -112,7 +113,7 @@ export function OutboundLinksList({ outboundLinks, isLoading, size = "small" }:
const totalCount = outboundLinks.reduce((sum, link) => sum + link.count, 0);
return (
- <div className="flex flex-col gap-2 pr-2 overflow-y-auto max-h-[60vh] h-auto lg:h-full lg:min-h-0 lg:max-h-full">
+ <div className="flex flex-col gap-2 overflow-y-auto max-h-[60vh] h-auto lg:h-full lg:min-h-0 lg:max-h-full">
{outboundLinks.map((link, index) => {
const percentage = (link.count / totalCount) * 100;
const lastClicked = DateTime.fromSQL(link.lastClicked, {
@@ -135,6 +136,7 @@ export function OutboundLinksList({ outboundLinks, isLoading, size = "small" }:
className={cn("z-10 flex justify-between items-center w-full", size === "small" ? "text-xs" : "text-sm")}
>
<div className="font-medium truncate max-w-[70%] flex items-center gap-1">
+ <Favicon domain={new URL(link.url).hostname} className="w-4 mr-1" />
<a
href={link.url}
target="_blank"
diff --git a/client/src/app/[site]/main/components/sections/Events.tsx b/client/src/app/[site]/main/components/sections/Events.tsx
index 1140b3a48..2b19a9bc8 100644
--- a/client/src/app/[site]/main/components/sections/Events.tsx
+++ b/client/src/app/[site]/main/components/sections/Events.tsx
@@ -45,9 +45,7 @@ function OutboundLinks({ expanded, close }: { expanded: boolean; close: () => vo
<div className="relative">
<div className="flex flex-row gap-2 justify-between pr-1 text-xs text-neutral-400 mb-2">
<div>Outbound Links</div>
- <div className="flex items-center gap-2">
- <div>Clicks</div>
- </div>
+ <div>Clicks</div>
</div>
<OutboundLinksList outboundLinks={(outboundLinksData || []).slice(0, 10)} isLoading={isLoadingOutboundLinks} />
<OutboundLinksDialog outboundLinks={outboundLinksData || []} expanded={expanded} close={close} />