-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xi duosi/event overview page #40
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful! This is great!
I left a few comments regarding making the data fetching statically generated instead of generated on request
I also found what I think is a visual bug
CleanShot.2024-05-03.at.13.24.11.mp4
options: string[] | ||
} | ||
|
||
export async function fetchEvents(options?: RequestInit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
<Page.Background withIndents> | ||
<Page.Boundary> | ||
<Page.Header>Events</Page.Header> | ||
<Suspense> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken suspense won't have any effect here since all the data is passed as props, if there would have been a query within this component suspense would make sense
import { Page } from "@/components/shared/Page" | ||
import { fetchEvents } from "@/components/shared/hooks/api/useEvents" | ||
import { Suspense } from "react" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make this page statically generated we need to implement generateStaticParams, this will help next to load all the events during build time, I think a good revalidation time here is quite short, maybe rebuild once every hour, to fix the revalidation I think you need to pass the following to the settings i
Update: Nvm this is not necessary for /events, only necessary for /events/:id which Valdemar is working on
student/events page