Skip to content

Commit

Permalink
Add username tooltip to user's avatar. Nice in the commenters list of…
Browse files Browse the repository at this point in the history
… a PostItem.
  • Loading branch information
Dominic Tracey committed Feb 3, 2017
1 parent eb2644a commit d0732c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/nova-base-components/lib/users/UsersAvatar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ const UsersAvatar = ({user, size, link}) => {
display: "inline-block",
height: sizes[size],
width: sizes[size]
};
};

const imgStyle = {
borderRadius: "100%",
display: "block",
height: sizes[size],
width: sizes[size]
};
};

const avatarUrl = Users.avatar.getUrl(user);

const img = <img alt={Users.getDisplayName(user)} style={imgStyle} className="avatar" src={avatarUrl}/>;
const img = <img alt={Users.getDisplayName(user)} style={imgStyle} className="avatar" src={avatarUrl} title={user.username}/>;
const initials = <span className="avatar-initials"><span>{Users.avatar.getInitials(user)}</span></span>;

const avatar = avatarUrl ? img : initials;
Expand All @@ -49,4 +49,4 @@ UsersAvatar.defaultProps = {

UsersAvatar.displayName = "UsersAvatar";

registerComponent('UsersAvatar', UsersAvatar);
registerComponent('UsersAvatar', UsersAvatar);

0 comments on commit d0732c4

Please sign in to comment.