scratch-www/src/components/stepnavigation/stepnavigation.jsx

30 lines
775 B
React
Raw Normal View History

const classNames = require('classnames');
const PropTypes = require('prop-types');
const React = require('react');
2016-03-29 10:07:23 -04:00
2016-06-16 10:54:36 -04:00
require('./stepnavigation.scss');
const StepNavigation = props => (
<ul className={classNames('step-navigation', props.className)}>
{Array(...Array(props.steps)).map((v, step) => (
<li
className={classNames({
active: step < props.active,
selected: step === props.active
})}
key={step}
>
<div className="indicator" />
</li>
))}
</ul>
);
StepNavigation.propTypes = {
active: PropTypes.number,
className: PropTypes.string,
steps: PropTypes.number
};
2016-06-16 10:54:36 -04:00
module.exports = StepNavigation;