Add title to <Avatar /> image

old
rubenmoya 2017-09-18 20:02:40 +02:00
parent e1f320c580
commit f815fb5db4
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ const factory = (FontIcon) => {
<div data-react-toolbox="avatar" className={classnames(theme.avatar, className)} {...other}>
{children}
{cover && typeof image === 'string' && <span aria-label={alt} className={theme.image} style={{ backgroundImage: `url(${image})` }} />}
{!cover && (typeof image === 'string' ? <img alt={alt} className={theme.image} src={image} /> : image)}
{!cover && (typeof image === 'string' ? <img alt={alt} className={theme.image} src={image} title={title} /> : image)}
{typeof icon === 'string' ? <FontIcon className={theme.letter} value={icon} alt={alt} /> : icon}
{title ? <span className={theme.letter}>{title[0]}</span> : null}
</div>