alerts: use shorthand return

This commit is contained in:
David Lechner
2022-11-22 15:56:56 -06:00
committed by David Lechner
parent 95199e44c1
commit 9fe62467d5
17 changed files with 109 additions and 140 deletions
+6 -8
View File
@@ -20,11 +20,9 @@ const FileInUseAlert: React.VoidFunctionComponent<FileInUseAlertProps> = ({
export const fileInUse: CreateToast<{ fileName: string }> = (
onAction,
{ fileName },
) => {
return {
message: <FileInUseAlert fileName={fileName} />,
icon: 'error',
intent: Intent.DANGER,
onDismiss: () => onAction('dismiss'),
};
};
) => ({
message: <FileInUseAlert fileName={fileName} />,
icon: 'error',
intent: Intent.DANGER,
onDismiss: () => onAction('dismiss'),
});
+6 -8
View File
@@ -17,11 +17,9 @@ const NoFilesToBackup: React.VoidFunctionComponent = () => {
);
};
export const noFilesToBackup: CreateToast = (onAction) => {
return {
message: <NoFilesToBackup />,
icon: 'info-sign',
intent: Intent.PRIMARY,
onDismiss: () => onAction('dismiss'),
};
};
export const noFilesToBackup: CreateToast = (onAction) => ({
message: <NoFilesToBackup />,
icon: 'info-sign',
intent: Intent.PRIMARY,
onDismiss: () => onAction('dismiss'),
});