Skip to content

Commit 8f621c9

Browse files
committed
fix tooltips
Signed-off-by: Adam Setch <[email protected]>
1 parent c1edf25 commit 8f621c9

File tree

4 files changed

+1218
-1342
lines changed

4 files changed

+1218
-1342
lines changed

src/renderer/components/notifications/AccountNotifications.tsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
import { type FC, type MouseEvent, useContext, useMemo, useState } from 'react';
22

33
import { GitPullRequestIcon, IssueOpenedIcon } from '@primer/octicons-react';
4-
import {
5-
Avatar,
6-
Button,
7-
IconButton,
8-
Stack,
9-
Text,
10-
Tooltip,
11-
} from '@primer/react';
4+
import { Avatar, Button, IconButton, Stack, Text } from '@primer/react';
125

136
import { AppContext } from '../../context/App';
147
import { type Account, type GitifyError, Size } from '../../types';
@@ -84,24 +77,23 @@ export const AccountNotifications: FC<IAccountNotifications> = (
8477
)}
8578
onClick={toggleAccountNotifications}
8679
>
87-
<Tooltip text="Open profile" direction="e">
88-
<Button
89-
variant="invisible"
90-
alignContent="center"
91-
count={notifications.length}
92-
onClick={(event: MouseEvent<HTMLElement>) => {
93-
// Don't trigger onClick of parent element.
94-
event.stopPropagation();
95-
openAccountProfile(account);
96-
}}
97-
data-testid="account-profile"
98-
>
99-
<Stack direction="horizontal" align="center" gap="condensed">
100-
<Avatar src={account.user.avatar} size={Size.MEDIUM} />
101-
<Text>@{account.user.login}</Text>
102-
</Stack>
103-
</Button>
104-
</Tooltip>
80+
<Button
81+
title="Open account profile"
82+
variant="invisible"
83+
alignContent="center"
84+
count={notifications.length}
85+
onClick={(event: MouseEvent<HTMLElement>) => {
86+
// Don't trigger onClick of parent element.
87+
event.stopPropagation();
88+
openAccountProfile(account);
89+
}}
90+
data-testid="account-profile"
91+
>
92+
<Stack direction="horizontal" align="center" gap="condensed">
93+
<Avatar src={account.user.avatar} size={Size.MEDIUM} />
94+
<Text>@{account.user.login}</Text>
95+
</Stack>
96+
</Button>
10597

10698
<HoverGroup>
10799
<IconButton

src/renderer/components/notifications/RepositoryNotifications.tsx

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
import { type FC, type MouseEvent, useContext, useState } from 'react';
22

33
import { CheckIcon, ReadIcon } from '@primer/octicons-react';
4-
import {
5-
Avatar,
6-
Button,
7-
IconButton,
8-
Stack,
9-
Text,
10-
Tooltip,
11-
} from '@primer/react';
4+
import { Avatar, Button, IconButton, Stack, Text } from '@primer/react';
125

136
import { AppContext } from '../../context/App';
147
import { Opacity, Size } from '../../types';
@@ -64,23 +57,22 @@ export const RepositoryNotifications: FC<IRepositoryNotifications> = ({
6457
showAsRead && Opacity.READ,
6558
)}
6659
>
67-
<Tooltip text="Open repository" direction="e">
68-
<Button
69-
variant="invisible"
70-
alignContent="center"
71-
count={repoNotifications.length}
72-
onClick={(event: MouseEvent<HTMLElement>) => {
73-
// Don't trigger onClick of parent element.
74-
event.stopPropagation();
75-
openRepository(repoNotifications[0].repository);
76-
}}
77-
>
78-
<Stack direction="horizontal" gap="condensed" align="center">
79-
<Avatar src={avatarUrl} size={Size.LARGE} />
80-
<Text>{repoName}</Text>
81-
</Stack>
82-
</Button>
83-
</Tooltip>
60+
<Button
61+
title="Open repository"
62+
variant="invisible"
63+
alignContent="center"
64+
count={repoNotifications.length}
65+
onClick={(event: MouseEvent<HTMLElement>) => {
66+
// Don't trigger onClick of parent element.
67+
event.stopPropagation();
68+
openRepository(repoNotifications[0].repository);
69+
}}
70+
>
71+
<Stack direction="horizontal" gap="condensed" align="center">
72+
<Avatar src={avatarUrl} size={Size.LARGE} />
73+
<Text>{repoName}</Text>
74+
</Stack>
75+
</Button>
8476
</div>
8577

8678
{!animateExit && (

0 commit comments

Comments
 (0)