-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: extract month slider into its own component #1518
base: main
Are you sure you want to change the base?
Conversation
0e0a640
to
bf1c5be
Compare
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.
Sorry for taking so long on this 😅
src/components/MonthSlider.tsx
Outdated
const activeMonth = | ||
searchParams.get('month')?.substring(0, 7) || monthYearFromDate(new Date()) |
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 think it makes more sense to pass this in the props. Depending on the usecase, we might not always encode the month in the url, and even if we do it doesn't make sense to parse it both in the Dashboard.tsx
and here.
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.
Thanks for the feedback, I changed it in e7742d9. Is this what you had in mind?
bf1c5be
to
e7742d9
Compare
This makes it possible to use the slider on other pages. I am currently working on a statistics page which uses the slider as well. Merging this refactor prevents future merge conflicts.
e7742d9
to
ba33b8c
Compare
This makes it possible to use the slider on other pages. I am currently working on a statistics page which uses the slider as well. Merging this refactor prevents future merge conflicts.