From 47a5f4d32762f2f43ca0ebfd6251862e62d4f3a8 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Tue, 17 Dec 2024 11:10:25 -0300 Subject: [PATCH] feat: add reset achievements modal --- src/locales/en/translation.json | 5 +- src/locales/pt-BR/translation.json | 5 +- .../modals/game-options-modal.tsx | 19 ++++++++ .../modals/reset-achievements-modal.tsx | 46 +++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 src/renderer/src/pages/game-details/modals/reset-achievements-modal.tsx diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 940e3185..f2adae8b 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -168,7 +168,10 @@ "select_folder": "Select folder", "backup_from": "Backup from {{date}}", "custom_backup_location_set": "Custom backup location set", - "no_directory_selected": "No directory selected" + "no_directory_selected": "No directory selected", + "reset_achievements": "Reset achievements", + "reset_achievements_description": "This will reset all achievements for {{game}}", + "reset_achievements_title": "Are you sure?" }, "activation": { "title": "Activate Hydra", diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index e724cdc3..30d8f322 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -164,7 +164,10 @@ "select_folder": "Selecione a pasta", "manage_files_description": "Gerencie quais arquivos serão feitos backup", "clear": "Limpar", - "no_directory_selected": "Nenhum diretório selecionado" + "no_directory_selected": "Nenhum diretório selecionado", + "reset_achievements": "Resetar conquistas", + "reset_achievements_description": "Isso irá resetar todas as conquistas de {{game}}", + "reset_achievements_title": "Tem certeza?" }, "activation": { "title": "Ativação", diff --git a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx index e5c83ec4..0d1fdc2c 100644 --- a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx @@ -7,6 +7,7 @@ import { gameDetailsContext } from "@renderer/context"; import { DeleteGameModal } from "@renderer/pages/downloads/delete-game-modal"; import { useDownload, useToast } from "@renderer/hooks"; import { RemoveGameFromLibraryModal } from "./remove-from-library-modal"; +import { ResetAchievementsModal } from "./reset-achievements-modal"; import { FileDirectoryIcon, FileIcon } from "@primer/octicons-react"; export interface GameOptionsModalProps { @@ -29,6 +30,8 @@ export function GameOptionsModal({ const [showDeleteModal, setShowDeleteModal] = useState(false); const [showRemoveGameModal, setShowRemoveGameModal] = useState(false); + const [showResetAchievementsModal, setShowResetAchievementsModal] = + useState(false); const { removeGameInstaller, @@ -134,6 +137,13 @@ export function GameOptionsModal({ game={game} /> + setShowResetAchievementsModal(false)} + // resetAchievements={handleResetAchievements} + game={game} + /> + {t("remove_from_library")} + + + + + + + + ); +}