Skip to content

Commit 1a9920b

Browse files
committed
revert: feat(accounts)
Signed-off-by: Adam Setch <[email protected]>
1 parent f2b3695 commit 1a9920b

File tree

2 files changed

+3
-167
lines changed

2 files changed

+3
-167
lines changed

src/routes/Accounts.tsx

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import {
33
PersonIcon,
44
PlusIcon,
55
SignOutIcon,
6-
StarFillIcon,
7-
StarIcon,
86
} from '@primer/octicons-react';
97

108
import { type FC, useCallback, useContext } from 'react';
@@ -14,19 +12,17 @@ import { AuthMethodIcon } from '../components/icons/AuthMethodIcon';
1412
import { PlatformIcon } from '../components/icons/PlatformIcon';
1513
import { AppContext } from '../context/App';
1614
import { BUTTON_CLASS_NAME } from '../styles/gitify';
17-
import { type Account, IconColor, Size } from '../types';
15+
import { type Account, Size } from '../types';
1816
import { getAccountUUID } from '../utils/auth/utils';
19-
import { cn } from '../utils/cn';
2017
import { updateTrayIcon, updateTrayTitle } from '../utils/comms';
2118
import {
2219
openAccountProfile,
2320
openDeveloperSettings,
2421
openHost,
2522
} from '../utils/links';
26-
import { saveState } from '../utils/storage';
2723

2824
export const AccountsRoute: FC = () => {
29-
const { auth, settings, logoutFromAccount } = useContext(AppContext);
25+
const { auth, logoutFromAccount } = useContext(AppContext);
3026
const navigate = useNavigate();
3127

3228
const logoutAccount = useCallback(
@@ -39,12 +35,6 @@ export const AccountsRoute: FC = () => {
3935
[logoutFromAccount],
4036
);
4137

42-
const setAsPrimaryAccount = useCallback((account: Account) => {
43-
auth.accounts = [account, ...auth.accounts.filter((a) => a !== account)];
44-
saveState({ auth, settings });
45-
navigate('/accounts', { replace: true });
46-
}, []);
47-
4838
const loginWithPersonalAccessToken = useCallback(() => {
4939
return navigate('/login-personal-access-token', { replace: true });
5040
}, []);
@@ -58,7 +48,7 @@ export const AccountsRoute: FC = () => {
5848
<Header icon={PersonIcon}>Accounts</Header>
5949
<div className="flex-grow overflow-x-auto px-8">
6050
<div className="mt-4 flex flex-col text-sm">
61-
{auth.accounts.map((account, i) => (
51+
{auth.accounts.map((account) => (
6252
<div
6353
key={getAccountUUID(account)}
6454
className="mb-4 flex items-center justify-between rounded-md bg-gray-100 p-2 dark:bg-gray-sidebar"
@@ -104,31 +94,6 @@ export const AccountsRoute: FC = () => {
10494
</div>
10595
</div>
10696
<div>
107-
<button
108-
type="button"
109-
className={cn(BUTTON_CLASS_NAME, 'cursor-default')}
110-
title="Primary account"
111-
hidden={i !== 0}
112-
>
113-
<StarFillIcon
114-
size={Size.XLARGE}
115-
className={IconColor.YELLOW}
116-
aria-label="Primary account"
117-
/>
118-
</button>
119-
<button
120-
type="button"
121-
className={BUTTON_CLASS_NAME}
122-
title="Set as primary account"
123-
onClick={() => setAsPrimaryAccount(account)}
124-
hidden={i === 0}
125-
>
126-
<StarIcon
127-
size={Size.XLARGE}
128-
className={IconColor.YELLOW}
129-
aria-label="Set as primary account"
130-
/>
131-
</button>
13297
<button
13398
type="button"
13499
className={BUTTON_CLASS_NAME}

src/routes/__snapshots__/Accounts.test.tsx.snap

Lines changed: 0 additions & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)