sugar-cat7 / vspo-portal

WIP すぽじゅーる
https://vspo-schedule-sugar-cat7-s-team.vercel.app
MIT License
10 stars 3 forks source link

Add locale and time zone selectors #450

Open sruenwg opened 5 days ago

sruenwg commented 5 days ago

This is a demo of one way we could implement locale and time zone switching.

https://github.com/sugar-cat7/vspo-portal/assets/155891765/a012c351-2684-4b67-85fa-7907df7a6462

I can turn this into a PR if it looks like an okay approach (assuming you have not picked up #432 yet — feel free to close this draft if you have already started #432), but I would like to ask about some concerns I had first:

  1. I used the NEXT_LOCALE cookie to save language preference since that is what Next seems to recommend (instead of localStorage as noted in #406) — wondering if this is alright.
  2. In order for the /schedule/[status] pages to match the user time zone, I believe we either have to:

    1. generate (SSG) a version of each /schedule/[status] page for every time zone,
    2. SSR on each request by passing the client time zone to the server, or
    3. CSR by passing all streams in the vicinity of the desired date to the client.

    I went with option 3 here out of ease of implementation (I pass all streams to each page) but obviously this likely hurts page performance. I feel the first two options might strain the server though, so I am unsure which approach is the least worst.

vercel[bot] commented 5 days ago

@sruenwg is attempting to deploy a commit to the sugar-cat7's Team Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 5 days ago

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

Name Status Preview Updated (UTC)
vspo-schedule ❌ Failed (Inspect) Jul 6, 2024 4:36am