mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 09:40:42 +08:00
32 lines
784 B
JavaScript
32 lines
784 B
JavaScript
import React, {PropTypes} from 'react';
|
|
import styles from './WizardNav.css';
|
|
import Icon from './Icon';
|
|
|
|
const WizardNav = (props) => {
|
|
const {goToStep = () => {}, currentStep, items, icon} = props;
|
|
return (
|
|
<nav className={styles.WizardNav}>
|
|
<ul>
|
|
{
|
|
items.map((item, i) => (
|
|
<li
|
|
key={i}
|
|
className={`${currentStep === item.step ? styles.active : ''} ${item.step < currentStep ? styles.done : ''}`}
|
|
onClick={() => goToStep(item.step)}>
|
|
{item.text}
|
|
{icon && <Icon name={icon} />}
|
|
<span/>
|
|
</li>
|
|
))
|
|
}
|
|
</ul>
|
|
</nav>
|
|
);
|
|
};
|
|
|
|
WizardNav.propTypes = {
|
|
currentStep: PropTypes.number.isRequired
|
|
};
|
|
|
|
export default WizardNav;
|