web2019/static/js/shop/CrateMode.jsx

22 lines
565 B
JavaScript

import React from 'react';
import {data as shared_data} from "./utils";
/**
* Component that displays crate modes
*/
export function CrateMode({current, onChange}) {
return (
<div className="crate-mode">
{shared_data.crateModeOrder.map(item => (
<a
key={item}
className={current === item ? 'active' : ''}
href="#"
role="button">{shared_data.crateModes[item].name}</a>
))}
</div>
);
}
//onClick={onChange(this, item)}