Skip to content

Commit b82bd29

Browse files
committed
feat: add 'on' prefix to handlers
1 parent 25f2e80 commit b82bd29

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

electron/renderer/components/sidebar/accounts/sidebar-item-accounts.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ export const SidebarItemAccounts: React.FC = (): ReactNode => {
9595
<EuiSpacer size="m" />
9696

9797
<TableListAccounts
98-
editAccountClick={onEditAccountClick}
99-
removeAccountClick={onRemoveAccountClick}
98+
onEditAccountClick={onEditAccountClick}
99+
onRemoveAccountClick={onRemoveAccountClick}
100100
/>
101101

102102
<EuiSpacer size="m" />

electron/renderer/components/sidebar/accounts/table-list-accounts.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ import {
66
EuiInMemoryTable,
77
EuiToolTip,
88
} from '@elastic/eui';
9-
import { type ReactNode, memo, useMemo } from 'react';
9+
import type { ReactNode } from 'react';
10+
import { memo, useMemo } from 'react';
1011
import { useListAccounts } from '../../../hooks/accounts.jsx';
1112
import type { Account } from '../../../types/game.types.js';
1213

1314
export interface TableListAccountsProps {
14-
editAccountClick: (account: Account) => void;
15-
removeAccountClick: (account: Account) => void;
15+
onEditAccountClick: (account: Account) => void;
16+
onRemoveAccountClick: (account: Account) => void;
1617
}
1718

1819
export const TableListAccounts: React.FC<TableListAccountsProps> = memo(
1920
(props: TableListAccountsProps): ReactNode => {
20-
const { editAccountClick, removeAccountClick } = props;
21+
const { onEditAccountClick, onRemoveAccountClick } = props;
2122

2223
// All accounts to display.
2324
const accounts = useListAccounts();
@@ -48,7 +49,7 @@ export const TableListAccounts: React.FC<TableListAccountsProps> = memo(
4849
iconType="lock"
4950
display="base"
5051
color="warning"
51-
onClick={() => editAccountClick(account)}
52+
onClick={() => onEditAccountClick(account)}
5253
/>
5354
</EuiToolTip>
5455
</EuiFlexItem>
@@ -59,7 +60,7 @@ export const TableListAccounts: React.FC<TableListAccountsProps> = memo(
5960
iconType="exit"
6061
display="base"
6162
color="danger"
62-
onClick={() => removeAccountClick(account)}
63+
onClick={() => onRemoveAccountClick(account)}
6364
/>
6465
</EuiToolTip>
6566
</EuiFlexItem>
@@ -68,7 +69,7 @@ export const TableListAccounts: React.FC<TableListAccountsProps> = memo(
6869
},
6970
},
7071
];
71-
}, [editAccountClick, removeAccountClick]);
72+
}, [onEditAccountClick, onRemoveAccountClick]);
7273

7374
return (
7475
<>

0 commit comments

Comments
 (0)