-
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
Fix/calendar fix #158
Fix/calendar fix #158
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.
The issue I mentioned before is still existing. If I change the data in getCurrentSprint file, the calendar will show the highlighted squares according to that date but the "today" date is the current date. There are 2 separate dates being used here. One in getcurrentsprint file and one in authprovider.
My suggestion would be to take the current date out of the function in the getcurrentsprint file and make it an export, and use that in the the authprovider.
Something like that. This way, not only do we have one source being used as the date but also if we need to manipulate the date, we don't need to go change it in multiple places (which is what we need to do currently)
There's also new instances of dates being used in other places too
src/app/(main)/dashboard/components/voyage-dashboard/VoyageDashboard.tsx
Outdated
Show resolved
Hide resolved
@Dan-Y-Ko Done! |
Description
I probably overdid it 😅, but I needed to change a few things to understand where to use time conversion. I just enhanced things a little bit, renamed some functions/variables, and removed variables that seemed confusing and unnecessary.
Separated calendar logic from event logic.
Calendar.logic
and removed some functions. For example, I moved thegenerateClassString
andgetCalendarElementColor
logic toCell.tsx
because they are related to cell styles. I believesetIsHoveredDate
triggered unnecessary re-renders, so usinghover:
and its combination withgroup
(for icons) seemed reasonable. I also moved the icon-related logic toCell.tsx
as well.Event.logic
.getEvents
instead ofshowDotConditions
(but the logic is pretty much the same) to simplify usingEventItem
in Calendar without all the conditionals.Cell
is now wrapped in abutton
, eliminating the need foronDotClick
and some other click handlers.Renamed the
EventList
type toMeetingEvent
.Removed time conversion from
getDashboardData
because all time conversions now occur inEvents.logic
.Issue link
I checked the calendar using Sensors in Google Chrome.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: