Improve animations

This commit is contained in:
Tom Raithel
2017-03-01 20:34:08 +01:00
parent 5f20c00bec
commit 6d4f1d0c09
5 changed files with 315 additions and 42 deletions

View File

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