-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from xbozo/feat/confirm-pack-delete
Add modal to confirm if user really wants to delete game archives
- Loading branch information
Showing
8 changed files
with
88 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { SPACING_UNIT } from "@renderer/theme.css"; | ||
import { style } from "@vanilla-extract/css"; | ||
|
||
export const deleteActionsButtonsCtn = style({ | ||
display: "flex", | ||
width: "100%", | ||
justifyContent: "end", | ||
alignItems: "center", | ||
gap: `${SPACING_UNIT}px`, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Button, Modal } from "@renderer/components"; | ||
import { useTranslation } from "react-i18next"; | ||
import * as styles from "./delete-modal.css"; | ||
|
||
interface DeleteModalProps { | ||
visible: boolean; | ||
onClose: () => void; | ||
deleting: boolean; | ||
deleteGame: () => void; | ||
} | ||
|
||
export function DeleteModal({ | ||
onClose, | ||
visible, | ||
deleting, | ||
deleteGame, | ||
}: DeleteModalProps) { | ||
const { t } = useTranslation("game_details"); | ||
|
||
const handleDeleteGame = () => { | ||
deleteGame(); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Modal | ||
visible={visible} | ||
title={t("delete_modal_title")} | ||
description={t("delete_modal_description")} | ||
onClose={onClose} | ||
> | ||
<div className={styles.deleteActionsButtonsCtn}> | ||
<Button onClick={handleDeleteGame} theme="outline" disabled={deleting}> | ||
{t("delete")} | ||
</Button> | ||
|
||
<Button onClick={onClose} theme="primary" disabled={deleting}> | ||
{t("cancel")} | ||
</Button> | ||
</div> | ||
</Modal> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters