Skip to content

Commit

Permalink
fix: Fix role desc expand in invite member modal
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed Feb 19, 2020
1 parent a3a2026 commit 62a6a56
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/components/Base/Avatar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,24 @@ export default class Avatar extends React.Component {
}

render() {
const { avatar, icon, iconSize, title, desc, to, noLink } = this.props
const {
className,
avatar,
icon,
iconSize,
title,
desc,
to,
noLink,
} = this.props

const titleComponent = to ? <Link to={to}>{title}</Link> : title

return (
<div
className={classNames(styles.wrapper, { [styles.link]: noLink || to })}
className={classNames(styles.wrapper, className, {
[styles.link]: noLink || to,
})}
>
{avatar ? (
<img
Expand All @@ -56,7 +67,9 @@ export default class Avatar extends React.Component {
)}
<div className={styles.text}>
<div className={styles.title}>{titleComponent}</div>
<div className={styles.description}>{desc}</div>
<div className={classNames(styles.description, 'ks-avatar-desc')}>
{desc}
</div>
</div>
</div>
)
Expand Down
1 change: 1 addition & 0 deletions src/components/Modals/InviteMember/User.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default class UserItem extends React.Component {
{roles.map(role => (
<Menu.MenuItem key={role.name}>
<Avatar
className={styles.avatar}
icon="role"
iconSize={40}
title={role.name}
Expand Down
9 changes: 9 additions & 0 deletions src/components/Modals/InviteMember/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,12 @@
font-weight: 600;
}
}


.avatar {
&:hover {
:global(.ks-avatar-desc) {
white-space: normal;
}
}
}

0 comments on commit 62a6a56

Please sign in to comment.