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.

timestamp in first column, enable hiding eventname/click

Steven Tey7a115daae753
diff --git a/apps/web/ui/analytics/events/events-table.tsx b/apps/web/ui/analytics/events/events-table.tsx
index 2943534b68..10a1b5b085 100644
--- a/apps/web/ui/analytics/events/events-table.tsx
+++ b/apps/web/ui/analytics/events/events-table.tsx
@@ -77,12 +77,42 @@ export default function EventsTable({
const columns = useMemo<ColumnDef<EventDatum, any>[]>(
() =>
[
+ // Date
+ {
+ id: "timestamp",
+ header: "Date",
+ accessorFn: (d: { timestamp: string }) => new Date(d.timestamp),
+ enableHiding: false,
+ minSize: 100,
+ cell: ({ getValue }) => (
+ <Tooltip
+ content={getValue().toLocaleTimeString("en-US", {
+ year: "numeric",
+ month: "short",
+ day: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ second: "numeric",
+ hour12: true,
+ })}
+ >
+ <div className="w-full truncate">
+ {getValue().toLocaleTimeString("en-US", {
+ month: "short",
+ day: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ hour12: true,
+ })}
+ </div>
+ </Tooltip>
+ ),
+ },
// Click trigger
{
id: "trigger",
header: "Event",
accessorKey: "qr",
- enableHiding: false,
meta: {
filterParams: ({ getValue }) => ({
qr: !!getValue(),
@@ -113,7 +143,6 @@ export default function EventsTable({
id: "event",
header: "Event",
accessorKey: "eventName",
- enableHiding: false,
cell: ({ getValue }) =>
getValue() ? (
<span className="truncate" title={getValue()}>
@@ -433,37 +462,6 @@ export default function EventsTable({
<span className="text-neutral-400">-</span>
),
},
- // Date
- {
- id: "timestamp",
- header: "Date",
- accessorFn: (d: { timestamp: string }) => new Date(d.timestamp),
- enableHiding: false,
- minSize: 100,
- cell: ({ getValue }) => (
- <Tooltip
- content={getValue().toLocaleTimeString("en-US", {
- year: "numeric",
- month: "short",
- day: "numeric",
- hour: "numeric",
- minute: "numeric",
- second: "numeric",
- hour12: true,
- })}
- >
- <div className="w-full truncate">
- {getValue().toLocaleTimeString("en-US", {
- month: "short",
- day: "numeric",
- hour: "numeric",
- minute: "numeric",
- hour12: true,
- })}
- </div>
- </Tooltip>
- ),
- },
// Menu
{
id: "menu",
diff --git a/apps/web/ui/analytics/toggle.tsx b/apps/web/ui/analytics/toggle.tsx
index 19b283a107..eda6701ccc 100644
--- a/apps/web/ui/analytics/toggle.tsx
+++ b/apps/web/ui/analytics/toggle.tsx
@@ -412,7 +412,7 @@ export default function Toggle({
? `/programs/${programSlug}/customers/${selectedCustomerId}`
: slug
? `/${slug}/customers/${selectedCustomerId}`
- : undefined;
+ : null;
},
options: customers?.map(({ id, email, name, avatar }) => {
return {