Add more components

This commit is contained in:
Tom Raithel
2017-02-21 22:58:35 +01:00
parent f284b4b310
commit 33b4d112a0
9 changed files with 125 additions and 46 deletions

24
js/components/ItemList.js Normal file
View File

@@ -0,0 +1,24 @@
import React from 'react';
import Item from './Item';
export default function ItemList({ children, items, activeItem, noLeadingBorder }) {
return (
<div className="item-list">
<div className="item-list__header">
{children}
</div>
<div className="item-list__list">
{
items.map(item => (
<Item
key={item.name}
item={item}
noLeadingBorder={noLeadingBorder}
active={typeof activeItem === 'object' && activeItem !== null && activeItem.name === item.name}
/>
))
}
</div>
</div>
);
}