Skip to content

Commit 91574b7

Browse files
authored
fix: account header quick links (#1511)
fix: account header event propagation Signed-off-by: Adam Setch <[email protected]>
1 parent d73adc4 commit 91574b7

File tree

2 files changed

+184
-132
lines changed

2 files changed

+184
-132
lines changed

src/components/AccountNotifications.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ export const AccountNotifications: FC<IAccountNotifications> = (
9393
onClick={toggleAccountNotifications}
9494
>
9595
<div className="flex">
96-
<div className="mr-2 flex items-center justify-center">
97-
<AvatarIcon
98-
title={account.user.login}
99-
url={account.user.avatar}
100-
size={Size.SMALL}
101-
defaultIcon={FeedPersonIcon}
102-
/>
103-
</div>
10496
<button
10597
type="button"
10698
title="Open Profile"
@@ -110,7 +102,15 @@ export const AccountNotifications: FC<IAccountNotifications> = (
110102
openAccountProfile(account);
111103
}}
112104
>
113-
@{account.user.login}
105+
<div className="flex">
106+
<AvatarIcon
107+
title={account.user.login}
108+
url={account.user.avatar}
109+
size={Size.SMALL}
110+
defaultIcon={FeedPersonIcon}
111+
/>
112+
<span className="ml-2">@{account.user.login}</span>
113+
</div>
114114
</button>
115115
</div>
116116
<HoverGroup>
@@ -119,13 +119,21 @@ export const AccountNotifications: FC<IAccountNotifications> = (
119119
title="My Issues"
120120
icon={IssueOpenedIcon}
121121
size={Size.SMALL}
122-
onClick={() => openGitHubIssues(account.hostname)}
122+
onClick={(event: MouseEvent<HTMLElement>) => {
123+
// Don't trigger onClick of parent element.
124+
event.stopPropagation();
125+
openGitHubIssues(account.hostname);
126+
}}
123127
/>
124128
<InteractionButton
125129
title="My Pull Requests"
126130
icon={GitPullRequestIcon}
127131
size={Size.SMALL}
128-
onClick={() => openGitHubPulls(account.hostname)}
132+
onClick={(event: MouseEvent<HTMLElement>) => {
133+
// Don't trigger onClick of parent element.
134+
event.stopPropagation();
135+
openGitHubPulls(account.hostname);
136+
}}
129137
/>
130138
<InteractionButton
131139
title={toggleAccountNotificationsLabel}

0 commit comments

Comments
 (0)