Skip to content

Commit

Permalink
feat: signout modal text
Browse files Browse the repository at this point in the history
  • Loading branch information
zamitto committed Jun 20, 2024
1 parent 66c7766 commit f0251ad
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
"sign_out_modal_title": "Are you sure?",
"cancel": "Cancel",
"sign_out": "Sign out",
"playing_for": "Playing for {{amount}}"
"playing_for": "Playing for {{amount}}",
"sign_out_modal_text": "Your library is linked with your current account. When signing out, your library will not be visible anymore, and any progress will not be saved. Continue with sign out?"
}
}
3 changes: 2 additions & 1 deletion src/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
"cancel": "Cancelar",
"sign_out": "Sair da conta",
"sign_out_modal_title": "Tem certeza?",
"playing_for": "Jogando por {{amount}}"
"playing_for": "Jogando por {{amount}}",
"sign_out_modal_text": "Sua biblioteca de jogos está associada com a sua conta atual. Ao sair, sua biblioteca não aparecerá mais no Hydra e qualquer progresso não será salvo. Deseja continuar?"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const signOut = async (_event: Electron.IpcMainInvokeEvent): Promise<void> => {
userAuthRepository.delete({ id: 1 }),
gameRepository.delete({}),
HydraApi.post("/auth/logout"),
]);
]).catch();
};

registerEvent("signOut", signOut);
2 changes: 1 addition & 1 deletion src/main/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import "./download-sources/validate-download-source";
import "./download-sources/add-download-source";
import "./download-sources/remove-download-source";
import "./download-sources/sync-download-sources";
import "./auth/signout";
import "./auth/sign-out";
import "./user/get-user";
import "./profile/get-me";
import "./profile/update-profile";
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/pages/user/user-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export function UserContent({
>
<>
<Button theme="outline" onClick={handleEditProfile}>
Editar perfil
{t("edit_profile")}
</Button>

<Button
Expand Down
9 changes: 2 additions & 7 deletions src/renderer/src/pages/user/user-signout-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ export const UserSignOutModal = ({
onClose={onClose}
>
<div className={styles.signOutModalContent}>
<p>Sua biblioteca de jogos está associada com a sua conta atual.</p>
<p>
Ao sair, sua biblioteca não aparecerá mais no Hydra e qualquer
progresso não será salvo.
</p>
<p>Deseja continuar?</p>
<p style={{ fontFamily: "Fira Sans" }}>{t("sign_out_modal_text")}</p>
<div className={styles.signOutModalButtonsContainer}>
<Button onClick={onConfirm} theme="outline">
<Button onClick={onConfirm} theme="danger">
{t("sign_out")}
</Button>

Expand Down

0 comments on commit f0251ad

Please sign in to comment.