Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Conversation

AmiyaSX
Copy link
Contributor

@AmiyaSX AmiyaSX commented May 2, 2024

student/events page

  • fetch data from ais
  • display event title, date and image
  • responsive in mobile

image
image
image

Copy link

vercel bot commented May 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
armada-nu ✅ Ready (Inspect) Visit Preview May 2, 2024 9:12pm

@AmiyaSX AmiyaSX linked an issue May 2, 2024 that may be closed by this pull request
Copy link
Member

@hampfh hampfh left a 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) {
Copy link
Member

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>
Copy link
Member

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"

Copy link
Member

@hampfh hampfh May 3, 2024

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

@hampfh
Copy link
Member

hampfh commented May 3, 2024

The images also has to be responsive with mid-size screens, around ~600px, in the following example the image gets very big

CleanShot 2024-05-03 at 13 42 10@2x

@AmiyaSX AmiyaSX closed this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add event overview page
2 participants