mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
fix/confirm-pack-delete: adjust code
This commit is contained in:
parent
99ad11a3e5
commit
8836984454
@ -2,51 +2,39 @@ import { Button, Modal } from "@renderer/components";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import * as styles from "./delete-modal.css";
|
||||
|
||||
type DeleteModalProps = {
|
||||
interface DeleteModalProps {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
description: string;
|
||||
onClose: () => void;
|
||||
deleting: boolean;
|
||||
deleteGame: () => void;
|
||||
};
|
||||
}
|
||||
|
||||
export function DeleteModal({
|
||||
description,
|
||||
onClose,
|
||||
title,
|
||||
visible,
|
||||
deleting,
|
||||
deleteGame,
|
||||
}: DeleteModalProps) {
|
||||
const { t } = useTranslation("game_details");
|
||||
|
||||
function handleDeleteGame() {
|
||||
deleteGame();
|
||||
onClose();
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
visible={visible}
|
||||
title={title}
|
||||
description={description}
|
||||
title={t("delete_modal_title")}
|
||||
description={t("delete_modal_description")}
|
||||
onClose={onClose}
|
||||
>
|
||||
<div className={styles.deleteActionsButtonsCtn}>
|
||||
<Button
|
||||
onClick={() => {
|
||||
deleteGame();
|
||||
onClose();
|
||||
}}
|
||||
theme="outline"
|
||||
disabled={deleting}
|
||||
>
|
||||
<Button onClick={handleDeleteGame} theme="outline" disabled={deleting}>
|
||||
{t("delete")}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
onClick={() => {
|
||||
onClose();
|
||||
}}
|
||||
theme="primary"
|
||||
disabled={deleting}
|
||||
>
|
||||
<Button onClick={onClose} theme="primary" disabled={deleting}>
|
||||
{t("cancel")}
|
||||
</Button>
|
||||
</div>
|
||||
|
@ -179,8 +179,6 @@ export function HeroPanel({
|
||||
|
||||
<DeleteModal
|
||||
visible={showDeleteModal}
|
||||
title={t("delete_modal_title")}
|
||||
description={t("delete_modal_description")}
|
||||
onClose={() => setShowDeleteModal(false)}
|
||||
deleting={deleting}
|
||||
deleteGame={() => deleteGame(game.id).then(getGame)}
|
||||
|
Loading…
Reference in New Issue
Block a user