-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
display percentage of achievement of todo in markdown #557
Conversation
Hello @sosukesuzuki, |
Thank you for commenting @LetItRock ! That might be nice! I will discuss it. |
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.
Hi! I commented 🖊️
|
||
for (let i = 0; i < splitted.length; i++) { | ||
let trimmedLine = splitted[i].trim() | ||
if (trimmedLine.match(/^- \[\s|x\] ./)) { |
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.
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.
Thank you for telling me. Oh... I had overlooked + and *. I'll add these operator.
let numberOfTodo = 0 | ||
let numberOfCompletedTodo = 0 | ||
|
||
for (let i = 0; i < splitted.length; i++) { |
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 assume forEach
is better than for
in this case.
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.
Thank you for commenting! Surely, It's long to using for
than using foreach
. So, I'll fix it.
@@ -95,6 +96,24 @@ class MarkdownNoteDetail extends React.Component { | |||
return title | |||
} | |||
|
|||
getPercentageOfCompleteTodo (value) { |
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 prefer the name of the argument is noteContent
.
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.
Thank you for commenting ! Surely it is difficult to understand it mean. I'll fix it.
}) => ( | ||
<div styleName='percentageBar' style={{display: isNaN(percentageOfTodo) ? 'none' : ''}}> | ||
<div styleName='progressBar' style={{width: percentageOfTodo + '%'}}> | ||
<p styleName='percentageText'>{percentageOfTodo + '%'}</p> |
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.
You can use string literal 😄
I will fix this UI at sometime soon🎨 |
I heard that There are people who using Boostnote as todo list. So, I made percentage of achievement it visible.