Add title to <Avatar /> image
parent
e1f320c580
commit
f815fb5db4
|
@ -10,7 +10,7 @@ const factory = (FontIcon) => {
|
||||||
<div data-react-toolbox="avatar" className={classnames(theme.avatar, className)} {...other}>
|
<div data-react-toolbox="avatar" className={classnames(theme.avatar, className)} {...other}>
|
||||||
{children}
|
{children}
|
||||||
{cover && typeof image === 'string' && <span aria-label={alt} className={theme.image} style={{ backgroundImage: `url(${image})` }} />}
|
{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}
|
{typeof icon === 'string' ? <FontIcon className={theme.letter} value={icon} alt={alt} /> : icon}
|
||||||
{title ? <span className={theme.letter}>{title[0]}</span> : null}
|
{title ? <span className={theme.letter}>{title[0]}</span> : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue