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. |
|
|
||
| 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.
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.
I assume forEach is better than for in this case.
There was a problem hiding this comment.
Thank you for commenting! Surely, It's long to using for than using foreach. So, I'll fix it.
| return title | ||
| } | ||
|
|
||
| getPercentageOfCompleteTodo (value) { |
There was a problem hiding this comment.
I prefer the name of the argument is noteContent.
There was a problem hiding this comment.
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.
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.