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

Save state on refresh, use URL state #169

Merged

Conversation

colbychaskell
Copy link
Member

Motivation

Addresses Issue #148

Moving the state to the query string also makes it easier to share specific views by and copying the link. Also could be nice to be able to bookmark a specific line + train type.

Changes

Adds React Router dependency

Primarily replaces the tabState with customHooks based on the useSearchParams hooks from React Router. Age and Line selection are stored in the query string.

Testing Instructions

Test changing lines and train ages. Page should stay the same on refresh or from bookmarking.

@github-actions github-actions bot added dependencies Changes to dependencies frontend Change to frontend code labels Dec 30, 2023
Copy link
Member

@devinmatte devinmatte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@colbychaskell colbychaskell merged commit 21ee8da into transitmatters:main Jan 20, 2024
3 checks passed
@colbychaskell colbychaskell deleted the save-state-on-refresh branch January 20, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Changes to dependencies frontend Change to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants