fix: search dropdown select, cleanup functional components

This commit is contained in:
David Ralph
2021-08-28 19:14:22 +01:00
parent 67ab7c8674
commit 21f8b63b80
13 changed files with 52 additions and 59 deletions

View File

@@ -1,15 +1,15 @@
export default function ProgressBar(props) {
export default function ProgressBar({ count, currentTab, switchTab }) {
return (
<div className='progressbar'>
{props.count.map((num) => {
{count.map((num) => {
let className = 'step';
const index = props.count.indexOf(num);
if (index === props.currentTab) {
const index = count.indexOf(num);
if (index === currentTab) {
className = 'step active';
}
return <div className={className} key={index} onClick={() => props.switchTab(index)}></div>;
return <div className={className} key={index} onClick={() => switchTab(index)}></div>;
})}
</div>
);