Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
RauliL committed Nov 2, 2024
1 parent 2ab7ccc commit b4f9f82
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
11 changes: 5 additions & 6 deletions src/frontend/components/DeleteAllEntriesListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ export type DeleteAllEntriesListItemProps = {
onClick: () => Promise<void>;
};

export const DeleteAllEntriesListItem: FunctionComponent<DeleteAllEntriesListItemProps> = ({
onClick,
}) => {
export const DeleteAllEntriesListItem: FunctionComponent<
DeleteAllEntriesListItemProps
> = ({ onClick }) => {
const [disabled, setDisabled] = useState<boolean>(false);
const [confirmationDialogOpen, setConfirmationDialogOpen] = useState<boolean>(
false
);
const [confirmationDialogOpen, setConfirmationDialogOpen] =
useState<boolean>(false);

const handleClick = () => setConfirmationDialogOpen(true);

Expand Down
26 changes: 12 additions & 14 deletions src/frontend/components/EntryListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,20 @@ export const EntryListItem: FunctionComponent<EntryListItemProps> = ({
toggle: false,
});

const handleButtonClick = (
callback: () => Promise<void>,
key: keyof EntryListItemButtons
) => () => {
setDisabledButtons((oldState) => ({
...oldState,
[key]: true,
}));

callback().finally(() =>
const handleButtonClick =
(callback: () => Promise<void>, key: keyof EntryListItemButtons) => () => {
setDisabledButtons((oldState) => ({
...oldState,
[key]: false,
}))
);
};
[key]: true,
}));

callback().finally(() =>
setDisabledButtons((oldState) => ({
...oldState,
[key]: false,
}))
);
};

return (
<ListItemButton onDoubleClick={onSelect}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ export type DeleteAllConfirmationDialogProps = {
open: boolean;
};

export const DeleteAllConfirmationDialog: FunctionComponent<DeleteAllConfirmationDialogProps> = ({
onAnswer,
open,
}) => {
export const DeleteAllConfirmationDialog: FunctionComponent<
DeleteAllConfirmationDialogProps
> = ({ onAnswer, open }) => {
const handleOnAnswer = (answer: boolean) => () => onAnswer(answer);

return (
Expand Down

0 comments on commit b4f9f82

Please sign in to comment.