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.

improvements

Steven Teyd8ac1d5b3981
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/event-tabs.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/event-tabs.tsx
index 4e6f769b51..dad47c15ce 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/event-tabs.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/event-tabs.tsx
@@ -13,7 +13,7 @@ export function EventTabs() {
{ value: "sales", label: "Sales" },
]}
selected={searchParams.get("event") ?? "clicks"}
- selectAction={(event) => queryParams({ set: { event } })}
+ selectAction={(event) => queryParams({ set: { event }, del: "page" })}
/>
);
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page.tsx
index 8ce626a090..242d57d7ba 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page.tsx
@@ -20,7 +20,7 @@ export default async function ReferralsPage({
}) {
const link = `https://refer.dub.co/${slug}`;
const event = (searchParams.event ?? "clicks") as EventType;
- const page = parseInt(searchParams.page ?? "1") || 1;
+ const page = parseInt(searchParams.page ?? "0") || 0;
return (
<ReferralsPageClient>
@@ -119,7 +119,7 @@ async function ActivityListRSC({
const events = await dub.events.list({
...eventsParams,
interval: "all",
- page: page - 1,
+ page,
});
const totalEvents = (await dub.analytics.retrieve({
diff --git a/apps/web/ui/blocks/event-list.tsx b/apps/web/ui/blocks/event-list.tsx
index 9f50ca815c..8927301c03 100644
--- a/apps/web/ui/blocks/event-list.tsx
+++ b/apps/web/ui/blocks/event-list.tsx
@@ -1,6 +1,6 @@
"use client";
-import { PAGINATION_LIMIT } from "@dub/utils";
+import { nFormatter, PAGINATION_LIMIT } from "@dub/utils";
import { PropsWithChildren, ReactNode } from "react";
import usePagination from "../analytics/events/use-pagination";
@@ -35,7 +35,7 @@ export function EventList({ events, totalEvents }: EventListProps) {
</div>
))}
</div>
- <div className="flex items-center justify-between gap-2 border-t border-gray-200 px-3.5 py-2 text-sm leading-6 text-gray-600">
+ <div className="sticky bottom-0 flex items-center justify-between gap-2 rounded-b-[inherit] border-t border-gray-200 bg-white px-3.5 py-2 text-sm leading-6 text-gray-600">
<div>
<span className="hidden sm:inline-block">Viewing</span>{" "}
<span className="font-medium">
@@ -45,7 +45,11 @@ export function EventList({ events, totalEvents }: EventListProps) {
totalEvents,
)}
</span>{" "}
- of <span className="font-medium">{totalEvents}</span> events
+ of{" "}
+ <span className="font-medium">
+ {nFormatter(totalEvents, { full: true })}
+ </span>{" "}
+ events
</div>
<div className="flex items-center gap-2">
<button