Merge pull request #16111 from desktop/Avatar-only-a-button-when-it-needs-to-be

Avatar only a button when it needs to be
This commit is contained in:
tidy-dev 2023-02-14 05:53:41 -05:00 committed by GitHub
commit 53598d3f1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,10 +71,17 @@ export class CommitMessageAvatar extends React.Component<
public render() {
return (
<div className="commit-message-avatar-component">
<Button className="avatar-button" onClick={this.onAvatarClick}>
{this.props.warningBadgeVisible && this.renderWarningBadge()}
{this.props.warningBadgeVisible && (
<Button className="avatar-button" onClick={this.onAvatarClick}>
{this.renderWarningBadge()}
<Avatar user={this.props.user} title={this.props.title} />
</Button>
)}
{!this.props.warningBadgeVisible && (
<Avatar user={this.props.user} title={this.props.title} />
</Button>
)}
{this.state.isPopoverOpen && this.renderPopover()}
</div>
)