-
Notifications
You must be signed in to change notification settings - Fork 0
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: countdown component #74
base: develop
Are you sure you want to change the base?
Conversation
6e6ec76
to
5c8eef5
Compare
2bf7e3c
to
dcbd740
Compare
/* | ||
caculate minutes | ||
*/ | ||
const resultCaculatMinute = Math.floor(seconds / numberSecondPerMinute) % numberSecondPerMinute |
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.
wrong typo
const resultCaculatMinute = Math.floor(seconds / numberSecondPerMinute) % numberSecondPerMinute | |
const resultCaculateMinute = Math.floor(seconds / numberSecondPerMinute) % numberSecondPerMinute |
caculate minutes | ||
*/ | ||
const resultCaculatMinute = Math.floor(seconds / numberSecondPerMinute) % numberSecondPerMinute | ||
const minute = resultCaculatMinute >= 0 ? resultCaculatMinute : 0 |
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.
why it need to be >= 0
? shouldn't it be only > 0
if resultCaculateMinute = 0, it will be same as the value return from else condition
caculate seconds | ||
*/ | ||
const resultCaculatSecond = Math.round(seconds % numberSecondPerMinute) | ||
const second = resultCaculatSecond >= 0 ? resultCaculatSecond : 0 |
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.
same with const minute
*/ | ||
if (FormatTime.ddhhmmss === FormatTime[format]) { | ||
const resultCaculatDay = Math.floor(seconds / secondPerDay) | ||
const day = resultCaculatDay >= 0 ? resultCaculatDay : 0 |
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.
also here
|
||
return ( | ||
<Container style={[CountDownTheme.containerStyle, containerStyle]}> | ||
{textDay && textDay} |
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.
should it convert to Boolean, because textDay has case = null, so if it return null it will return error string outside Text component
Summary
Features
Bugs
Check List
Proof of Completeness