-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: persistence of searchParams for leaderboard #151
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the query params persist when you click into the profile. I'm not entirely sure if they should. We could have different pages within the profile potentially.
Do you think the "type" query param should have value of "1v1", "team", etc. so that the url makes more sense to the user?
Functionality seems great from what I tested, thanks for including the testing steps.
export const useQueryParams = <T extends Record<string, string>>(params: T): QueryParams<T> => { | ||
const router = useRouter(); | ||
|
||
return useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm new to using useMemo
. As I understand it, this is caching the "page" so that it isn't recalculated when navigating back/forward I assume? Let me know if there was another purpose that I missed. Thanks for adding this.
No the persistence for the profile page makes no sense and could be fixed. I was aware of this though, the reason I did initialise the pull request is that I don't consider this something breaking. The parameter is not adjusting anything for the profile page. So yes, definitely make a new issue and I or someone else can fix this at a later stage IMO. For the type query, it is possible to adjust the params, but for those types that are long and contain spaces, it can be a little bit annoying to maintain since we need to hashmap "Team Deathmatch" to "Team_Deatchmatch". The numbers make even less sense though. But yeah not sure if this is something for the current PR or something that we should change later. Let me know what your preferences are. |
If it's not too hard, would prefer to cleanup the search params in the
profile. A lot of people share this link and I don't want it to look sloppy.
Please use some enum for the leaderboard types...they might already exist.
…On Mon, Oct 7, 2024, 11:43 AM Gijs van Everdingen ***@***.***> wrote:
I noticed that the query params persist when you click into the profile.
I'm not entirely sure if they should. We could have different pages within
the profile potentially.
Do you think the "type" query param should have value of "1v1", "team",
etc. so that the url makes more sense to the user?
Functionality seems great from what I tested, thanks for including the
testing steps.
No the persistence for the profile page makes no sense and could be fixed.
I was aware of this though, the reason I did initialise the pull request is
that I don't consider this something breaking. The parameter is not
adjusting anything for the profile page. So yes, definitely make a new
issue and I or someone else can fix this at a later stage IMO.
For the type query, it is possible to adjust the params, but for those
types that are long and contain spaces, it can be a little bit annoying to
maintain since we need to hashmap "Team Deathmatch" to "Team_Deatchmatch".
The numbers make even less sense though. But yeah not sure if this is
something for the current PR or something that we should change later. Let
me know what your preferences are.
—
Reply to this email directly, view it on GitHub
<#151 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALCQKAJ5OAVI3G5DGG4QD2DZ2KTZPAVCNFSM6AAAAABPMZWU66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJXGI4DIMJQGI>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
@gijs-ve - hey just was wondering if you were planning on finishing up this PR at some point. |
Heya definitely will finish this when I find the time! |
Added queryParams to leaderboard homepage (#132)
How to test: