-
Notifications
You must be signed in to change notification settings - Fork 8
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
Edit Mark Modal UI #104
Edit Mark Modal UI #104
Conversation
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 have one question, but you can fix it by you own
src/modals/MarkModal.tsx
Outdated
lastCycleFinish.setHours(0, 0, 0, 0); | ||
|
||
return date.getTime() > lastCycleFinish.getTime(); | ||
const isActiveDates = (date: string) => { |
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.
Do we really need this function? You ca just call function from CalculationLogic instead
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.
These calculations have been moved to CalculationLogic
. This function calls the getMarkModalActiveDates
function from CalculationLogic
.
But after the comment, I removed this function. Now the getMarkModalActiveDates
function is calculated directly from
isDateEnabled={(date: string) => {
return getMarkModalActiveDates(date, cycles);
}}
Closed #94
I changed the ui. Now it looks like this
I also moved all calculations to the
CalculationLogics.ts
.I created
getPastFuturePeriodDays
function. In theMark Modal
, in thevalue
property, I need to transfer all the past period days and the marked current ones. I already have a function for calculating past days -getLastPeriodDays
. But for theMark Modal
, I also need to pass the estimated values of the marked periods. That's why I created thegetPastFuturePeriodDays
function. In it, I first call agetLastPeriodDays
function to pass the days of the past period, and then I count the current ones.Now I also updated storage using
getNewCyclesHistory
. It is past function.I created a new function to set active dates specifically for
Mark Modal
-getMarkModalActiveDates
. However, there is already a similargetActiveDates
function but with an additional condition. I don't know how to fix it.