mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-22 06:01:45 +00:00
display percentage of achievement of todo in markdown
This commit is contained in:
13
browser/components/TodoListPercentage.styl
Normal file
13
browser/components/TodoListPercentage.styl
Normal 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
|
||||
29
browser/components/TodolistPercentage.js
Normal file
29
browser/components/TodolistPercentage.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @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)
|
||||
Reference in New Issue
Block a user