Events page#6
Conversation
…o understandgit add .git add .!
LastS3cond
left a comment
There was a problem hiding this comment.
This looks pretty good. Only big comment is about separating the normalization of data from the display component. I said you could do this by moving all the display info into another component, but you could also move the data normalization into the backend.
Approved.
| </p> | ||
| </header> | ||
|
|
||
| {/* Event cards */} |
There was a problem hiding this comment.
Can we make a component for this? If the logic is fairly simple then this file can focus more on normalization.
| * Normalized event with parsed dates and computed properties | ||
| * Used internally after processing from raw API response | ||
| */ | ||
| type NormalizedEvent = { |
There was a problem hiding this comment.
IMO, perhaps we should skip events without a summary. I could see the argument for keeping events without a location, but wouldn't events without a summary display weirdly / look off? We could also normalize the name to "BITS Event" or smth.
Your choice
|
The way calendar fetching implemented is incompatible with our current way of statically deploying the website which prevents us from using Nextjs as an API backend. Using the public iCal link from our calendar on the client side would probably be a better idea than exposing an API key. |
Automated Events page by integrating the Google Calendar API. Reads JSON data for event details.
To test this feature:
Create a .env file and fill in:
GOOGLE_API_KEY = [ THE API KEY ]
GOOGLE_CALENDAR_ID = bitsatvt@gmail.com
Run localhost and log into Google Calendar with the BITS account
Finally, create an event! You can change it up and it will automatically update. Events that are past the current date will not show up.