Skip to content

Commit ed38cfc

Browse files
committed
feat(events): migrate events workspace to TanStack Query and shared loading screen
1 parent a0f536e commit ed38cfc

26 files changed

Lines changed: 718 additions & 1528 deletions

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@radix-ui/react-slot": "^1.2.4",
1515
"@radix-ui/react-tabs": "^1.1.13",
1616
"@supabase/supabase-js": "^2.95.3",
17+
"@tanstack/react-query": "^5.101.2",
1718
"@tanstack/react-table": "^8.21.3",
1819
"@tanstack/react-virtual": "^3.13.18",
1920
"@uiw/react-json-view": "^2.0.0-alpha.42",

web/src/app/(dashboard)/events/page.tsx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function getEvents(): Promise<Event[]> {
1717
cache: "no-store",
1818
}
1919
)
20-
20+
console.log(res)
2121
if (!res.ok) {
2222
return []
2323
}
@@ -38,10 +38,38 @@ export default async function EventsPage() {
3838
}
3939

4040
const events = await getEvents()
41+
console.log("Server Events:", events.length)
4142

4243
return (
4344
<EventsWorkspaceClient
4445
initialEvents={events}
4546
/>
4647
)
47-
}
48+
}
49+
50+
51+
52+
// export const dynamic = "force-dynamic"
53+
54+
// import { redirect } from "next/navigation"
55+
56+
// import { getCurrentUser } from "@/lib/auth"
57+
// import { getEvents } from "@/lib/services/events"
58+
59+
// import { EventsWorkspaceClient } from "@/components/events/events-workspace-client"
60+
61+
// export default async function EventsPage() {
62+
// const user = await getCurrentUser()
63+
64+
// if (!user) {
65+
// redirect("/login")
66+
// }
67+
68+
// const data = await getEvents()
69+
70+
// return (
71+
// <EventsWorkspaceClient
72+
// initialEvents={data?.items ?? []}
73+
// />
74+
// )
75+
// }

0 commit comments

Comments
 (0)