Skip to content

Instantly share code, notes, and snippets.

@jamesslock
Last active February 13, 2016 22:03
Show Gist options
  • Save jamesslock/42a52e9e1457a8bb016e to your computer and use it in GitHub Desktop.
Save jamesslock/42a52e9e1457a8bb016e to your computer and use it in GitHub Desktop.
Basic Progress Bar React
import React, { Component, PropTypes } from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './ProgressBar.scss';
class ProgressBar extends Component {
render() {
const completed = +this.props.completed;
const style = {
width: completed + '%',
};
return (
<div className={s.root}>
<div className={s.bar} style={style}></div>
</div>
);
}
}
export default withStyles(ProgressBar, s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment