mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
30 lines
666 B
JavaScript
30 lines
666 B
JavaScript
import React, {PropTypes} from 'react';
|
|
import styles from './WizardNav.css';
|
|
|
|
const WizardNav = props => {
|
|
const {goToStep, currentStep, items} = props;
|
|
return (
|
|
<nav className={styles.WizardNav}>
|
|
<ul>
|
|
{
|
|
items.map((item, i) => (
|
|
<li
|
|
key={i}
|
|
className={currentStep === item.step ? styles.active : ''}
|
|
onClick={() => goToStep(item.step)}>
|
|
{item.text}<span/>
|
|
</li>
|
|
))
|
|
}
|
|
</ul>
|
|
</nav>
|
|
);
|
|
};
|
|
|
|
WizardNav.propTypes = {
|
|
goToStep: PropTypes.func.isRequired,
|
|
currentStep: PropTypes.number.isRequired
|
|
};
|
|
|
|
export default WizardNav;
|