Skip to content

feat: add theme param url behaviour with react-router #69

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

Merged
merged 3 commits into from
Nov 17, 2024

Conversation

hunxjunedo
Copy link
Collaborator

Description

makes a theme focused directly thru the url with the help of react-router and searchParams

Closes #66

@hunxjunedo hunxjunedo requested review from a team and tjtanjin and removed request for tjtanjin November 14, 2024 15:37
Copy link
Member

@tjtanjin tjtanjin left a comment

Choose a reason for hiding this comment

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

The idea is great, it brings good quality of life improvements for users. That said, I notice several double assertions (e.g. theme as unknown as boolean). The focusedTheme state seems to imply that it will hold the value of the theme being focused on, but it turns out to be a boolean. Perhaps, consider having focusedTheme be of type string or null instead of a boolean, which would remove the need for double assertions. Checks would then be performed based no whether there is a theme focused.

In addition, the ThemeModal has been moved up to the Themes page. Since its rendering is now conditional based on focusedTheme, we also no longer need the isOpen prop (which takes its value from focusedTheme) passed into ThemeModal.

@hunxjunedo
Copy link
Collaborator Author

Yes, I left some refactoring that had to be done, this is not complete yet 👍

@hunxjunedo hunxjunedo requested a review from tjtanjin November 16, 2024 08:02
Copy link
Member

@tjtanjin tjtanjin left a comment

Choose a reason for hiding this comment

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

Some small nit picks!

@hunxjunedo hunxjunedo requested a review from tjtanjin November 17, 2024 13:26
Copy link
Member

@tjtanjin tjtanjin left a comment

Choose a reason for hiding this comment

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

LGTM!

@hunxjunedo hunxjunedo merged commit 87227b1 into main Nov 17, 2024
1 check passed
@hunxjunedo hunxjunedo deleted the react-router-themes branch November 18, 2024 19:43
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.

[Task] use router in themes
2 participants