diff --git a/components/List/ListDivider.jsx b/components/List/ListDivider.jsx index 701e4638..10205244 100644 --- a/components/List/ListDivider.jsx +++ b/components/List/ListDivider.jsx @@ -1,7 +1,4 @@ -import React from 'react'; -import PropTypes from 'prop-types'; import styled from 'styled-components'; -import Icon from '../Icon'; const Divider = styled.li` background-color: #a2a5a8; diff --git a/components/List/ListItem.jsx b/components/List/ListItem.jsx index 7d5f3df3..4350a44d 100644 --- a/components/List/ListItem.jsx +++ b/components/List/ListItem.jsx @@ -71,18 +71,30 @@ const Item = styled.li` `}; `; -const ListItem = ({ icon, children, onClick, rest }) => ( +const ListItem = ({ icon, children, onClick, ...rest }) => ( children.type === List, + children => children.type === List ).some(child => child)} > {icon && } {children} ); + +ListItem.PropTypes = { + icon: PropTypes.string, + children: PropTypes.node.isRequired, + onClick: PropTypes.func, +}; + +ListItem.defaultProps = { + icon: '', + onClick: () => {}, +}; + export default ListItem;