Indentify Avatar by constructur in Chip

old
Javi Velasco 2016-04-10 22:31:28 +02:00
parent eb483dddac
commit 6665753a7a
1 changed files with 2 additions and 1 deletions

View File

@ -1,12 +1,13 @@
import React, {PropTypes} from 'react';
import ClassNames from 'classnames';
import Avatar from '../avatar';
import style from './style';
const Chip = ({children, className, deletable, onDeleteClick, ...other}) => {
let hasAvatar = false;
if (React.Children.count(children)) {
const firstChild = children[0];
hasAvatar = firstChild && firstChild.type && firstChild.type.name === 'Avatar';
hasAvatar = firstChild && firstChild.type && firstChild.type === Avatar;
}
const classes = ClassNames(style.chip, {