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

refactor: extract month slider into its own component #1518

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ekeih
Copy link
Contributor

@ekeih ekeih commented Feb 1, 2024

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.

@ekeih ekeih marked this pull request as ready for review February 1, 2024 13:22
@ekeih ekeih requested a review from a team as a code owner February 1, 2024 13:22
@ekeih ekeih force-pushed the extract-month-slider branch 2 times, most recently from 0e0a640 to bf1c5be Compare February 2, 2024 19:23
Copy link
Contributor

@malfynnction malfynnction left a 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/Dashboard.tsx Show resolved Hide resolved
Comment on lines 51 to 52
const activeMonth =
searchParams.get('month')?.substring(0, 7) || monthYearFromDate(new Date())
Copy link
Contributor

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.

Copy link
Contributor Author

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?

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.
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.

2 participants