1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 18:56:22 +00:00

Merge pull request #557 from BoostIO/feature-todo-percentage

display percentage of achievement of todo in markdown
This commit is contained in:
Kazu Yokomizo
2017-05-20 13:51:30 +09:00
committed by GitHub
3 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
.percentageBar
position absolute
background-color #bcbcbc
height 20px
width 100%
.progressBar
background-color #52d8a5
height 20px
text-align center
.progressBar p
color white

View File

@@ -0,0 +1,27 @@
/**
* @fileoverview Percentage of todo achievement.
*/
import React, { PropTypes } from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './TodoListPercentage.styl'
/**
* @param {number} percentageOfTodo
*/
const TodoListPercentage = ({
percentageOfTodo
}) => (
<div styleName='percentageBar' style={{display: isNaN(percentageOfTodo) ? 'none' : ''}}>
<div styleName='progressBar' style={{width: `${percentageOfTodo}%`}}>
<p styleName='percentageText'>{percentageOfTodo}%</p>
</div>
</div>
)
TodoListPercentage.propTypes = {
percentageOfTodo: PropTypes.number.isRequired
}
export default CSSModules(TodoListPercentage, styles)