function ProgressBar(props) {
const { done, total, units, color } = props
const width = Math.floor(done / total * 100)
const rest = 100 - width
let [fg, bg] = [`bg-${color}`, `bg-${color}-lightest`]
if (color === 'white') {
[fg, bg] = ['bg-grey', 'bg-grey-lightest']
}
return (
{done} of {total} {units}
)
}
function Goal(props) {
const { subject, goal, done, total, units, color } = props
const width = "6em"
const Tr = (props) => (
{props.label} |
{props.valueComponent ? props.valueComponent : props.value}
|
)
return (
)
}
function Copy(props) {
return (
{props.children}
)
}
function App() {
return (
Goals
For me, a goal is something that is difficult for me to complete but
easy for me to measure. I tend to add new goals as time progresses,
mistakenly assuming that I can support additional goals for free. To
counterbalance my tendancy to casually accumulate goals, I aim to only
have three goals; I will not add a new goal until I complete an
existing goal. I created and published this page to clarify that idea.
Here are my current goals and the progress I have made towards
achieving them.
)
}
ReactDOM.render(, document.getElementById('root'))