Skip to content

Commit

Permalink
Indentify Avatar by constructur in Chip
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco committed Apr 10, 2016
1 parent eb483dd commit 6665753
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/chip/Chip.js
@@ -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, {
Expand Down

0 comments on commit 6665753

Please sign in to comment.