Fix ESLint issues

This commit is contained in:
Pierre HUBERT 2025-04-28 19:12:42 +02:00
parent e2e8f9ce5e
commit ee145dab4f
3 changed files with 11 additions and 11 deletions

View File

@ -36,7 +36,7 @@ export function SelectAccountDialog(p: {
}; };
return ( return (
<Dialog open={p.open} onClose={() => p.onClose()}> <Dialog open={p.open} onClose={() => { p.onClose(); }}>
<DialogTitle>{p.title}</DialogTitle> <DialogTitle>{p.title}</DialogTitle>
<DialogContent dividers> <DialogContent dividers>
<DialogContentText>{p.description}</DialogContentText> <DialogContentText>{p.description}</DialogContentText>
@ -53,7 +53,7 @@ export function SelectAccountDialog(p: {
undefined undefined
} }
checked={option.id === choice?.id} checked={option.id === choice?.id}
onChange={() => setChoice(option)} onChange={() => { setChoice(option); }}
/> />
} }
label={ label={
@ -72,7 +72,7 @@ export function SelectAccountDialog(p: {
</RadioGroup> </RadioGroup>
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
<Button onClick={() => p.onClose()}>Cancel</Button> <Button onClick={() => { p.onClose(); }}>Cancel</Button>
<Button onClick={submit} autoFocus disabled={choice === null}> <Button onClick={submit} autoFocus disabled={choice === null}>
{p.confirmButton ?? "Submit"} {p.confirmButton ?? "Submit"}
</Button> </Button>

View File

@ -54,9 +54,9 @@ export function ChooseAccountDialogProvider(
return ( return (
<> <>
<DialogContextK.Provider value={hook}> <DialogContextK value={hook}>
{p.children} {p.children}
</DialogContextK.Provider> </DialogContextK>
{open && ( {open && (
<SelectAccountDialog <SelectAccountDialog
@ -74,5 +74,5 @@ export function ChooseAccountDialogProvider(
} }
export function useSelectAccount(): DialogContext { export function useSelectAccount(): DialogContext {
return React.useContext(DialogContextK)!; return React.use(DialogContextK)!;
} }

View File

@ -77,7 +77,7 @@ export function AccountRoute(): React.ReactElement {
<AsyncWidget <AsyncWidget
loadKey={`${account.id}-${loadKey.current}`} loadKey={`${account.id}-${loadKey.current}`}
load={load} load={load}
ready={movements !== null} ready={movements}
errMsg="Failed to load the list of movements!" errMsg="Failed to load the list of movements!"
build={() => ( build={() => (
<MovementsTable needReload={reload} movements={movements!} /> <MovementsTable needReload={reload} movements={movements!} />
@ -166,7 +166,7 @@ function MovementsTable(p: {
movements: movements:
<ul> <ul>
{movements.map((m) => ( {movements.map((m) => (
<li> <li key={m.id}>
{m.label} ({m.amount} ) {m.label} ({m.amount} )
</li> </li>
))} ))}
@ -209,7 +209,7 @@ function MovementsTable(p: {
Do you really want to delete the following movements: Do you really want to delete the following movements:
<ul> <ul>
{movements.map((m) => ( {movements.map((m) => (
<li> <li key={m.id}>
{m.label} ({m.amount} ) {m.label} ({m.amount} )
</li> </li>
))} ))}
@ -294,7 +294,7 @@ function MovementsTable(p: {
editable: false, editable: false,
getActions: (params) => { getActions: (params) => {
return [ return [
<Tooltip title="Move to another account"> <Tooltip title="Move to another account" key="move">
<GridActionsCellItem <GridActionsCellItem
icon={<DriveFileMoveOutlineIcon />} icon={<DriveFileMoveOutlineIcon />}
label="Move to another account" label="Move to another account"
@ -302,7 +302,7 @@ function MovementsTable(p: {
color="inherit" color="inherit"
/> />
</Tooltip>, </Tooltip>,
<Tooltip title="Delete the movement"> <Tooltip title="Delete the movement" key="delete">
<GridActionsCellItem <GridActionsCellItem
icon={<DeleteIcon color="error" />} icon={<DeleteIcon color="error" />}
label="Delete" label="Delete"