olin-build / abe-web

Web Calendar front-end to ABE (Amorphous Blob of Events)
https://events.olin.build/
MIT License
5 stars 4 forks source link

Encode current view info (i.e. month/week/day) in the URL #262

Open kylecombes opened 3 years ago

kylecombes commented 3 years ago

Right now only the currently visible labels are encoded in the URL (meaning you can refresh the page or share the link and the visible labels are preserved). It would be great if the view mode (i.e. month, week, day) and the month/day/etc being viewed was encoded in the URL so that reloading the page or sharing the link resulted in the same exact view of the calendar popping back up.

Relevant libraries:

While the labels are encoded in the URL, I don't recall if that's done the proper way with React Router. You can look at the labels code for inspiration, but I wouldn't necessarily consider it to be done right. Prefer the style in the React Router docs.