Skip to content

Commit

Permalink
feat: add 'on' prefix to handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
KatoakDR committed Sep 7, 2024
1 parent 25f2e80 commit b82bd29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export const SidebarItemAccounts: React.FC = (): ReactNode => {
<EuiSpacer size="m" />

<TableListAccounts
editAccountClick={onEditAccountClick}
removeAccountClick={onRemoveAccountClick}
onEditAccountClick={onEditAccountClick}
onRemoveAccountClick={onRemoveAccountClick}
/>

<EuiSpacer size="m" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ import {
EuiInMemoryTable,
EuiToolTip,
} from '@elastic/eui';
import { type ReactNode, memo, useMemo } from 'react';
import type { ReactNode } from 'react';
import { memo, useMemo } from 'react';
import { useListAccounts } from '../../../hooks/accounts.jsx';
import type { Account } from '../../../types/game.types.js';

export interface TableListAccountsProps {
editAccountClick: (account: Account) => void;
removeAccountClick: (account: Account) => void;
onEditAccountClick: (account: Account) => void;
onRemoveAccountClick: (account: Account) => void;
}

export const TableListAccounts: React.FC<TableListAccountsProps> = memo(
(props: TableListAccountsProps): ReactNode => {
const { editAccountClick, removeAccountClick } = props;
const { onEditAccountClick, onRemoveAccountClick } = props;

// All accounts to display.
const accounts = useListAccounts();
Expand Down Expand Up @@ -48,7 +49,7 @@ export const TableListAccounts: React.FC<TableListAccountsProps> = memo(
iconType="lock"
display="base"
color="warning"
onClick={() => editAccountClick(account)}
onClick={() => onEditAccountClick(account)}
/>
</EuiToolTip>
</EuiFlexItem>
Expand All @@ -59,7 +60,7 @@ export const TableListAccounts: React.FC<TableListAccountsProps> = memo(
iconType="exit"
display="base"
color="danger"
onClick={() => removeAccountClick(account)}
onClick={() => onRemoveAccountClick(account)}
/>
</EuiToolTip>
</EuiFlexItem>
Expand All @@ -68,7 +69,7 @@ export const TableListAccounts: React.FC<TableListAccountsProps> = memo(
},
},
];
}, [editAccountClick, removeAccountClick]);
}, [onEditAccountClick, onRemoveAccountClick]);

return (
<>
Expand Down

0 comments on commit b82bd29

Please sign in to comment.