From ee1dd7b21fa44e594c109d598f354080c456d7f2 Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Thu, 2 Mar 2023 00:19:06 +0100 Subject: [PATCH] add credentials informations --- assets/jsons/translations/en.json | 6 +++++ assets/jsons/translations/es.json | 6 +++++ assets/jsons/translations/fr.json | 6 +++++ .../modal-types/login-modal.component.tsx | 17 ++++++++---- .../why-credentials-modal.component.tsx | 26 +++++++++++++++++++ 5 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 src/renderer/components/modal/modal-types/why-credentials-modal.component.tsx diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 13179f94..db4c69aa 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -447,10 +447,16 @@ "label": "Stay connected" } }, + "why-credentials": "Why do you need my credentials ?", "buttons": { "submit": "Login" } }, + "steam-credentials":{ + "title": "Steam Credentials", + "p-1": "The credentials are only used to download the game because steam need to verify that you paid the game in order to be allowed to download it. They aren't saved and directly passed to DepotDownloader. If you don't want to enter your credentials you can follow this tutorial :", + "p-2": "and then click on the gear icon in the top right corner and select \"Import a version\", select the folder where beat saber has been downloaded (If you follow the tutorial above you should have the correct location)" + }, "bs-import-version":{ "title": "Import a version", "description": "Imports a version of BeatSaber to use with BSManager. The import will copy the selected BeatSaber installation folder to the BSManager versions folder.", diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index d73d295f..aed30eec 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -446,10 +446,16 @@ "label": "Manténgase conectado" } }, + "why-credentials": "¿Por qué necesitas mis credenciales?", "buttons": { "submit": "Inicio de sesión" } }, + "steam-credentials":{ + "title": "Steam Credentials", + "p-1": "Las credenciales sólo se utilizan para descargar el juego porque steam necesita verificar que has pagado el juego para que se te permita descargarlo. No se guardan y se pasan directamente a DepotDownloader. Si no quieres introducir tus credenciales puedes seguir este tutorial :", + "p-2": "y, a continuación, haga clic en el icono de engranaje en la esquina superior derecha y seleccione \"Importar una versión\", seleccione la carpeta donde se ha descargado beat saber (Si usted sigue el tutorial anterior debe tener la ubicación correcta)" + }, "bs-import-version":{ "title": "Importar una versión", "description": "Importa una versión de BeatSaber para usar con BSManager. La importación copiará la carpeta de instalación seleccionada de BeatSaber en la carpeta de versiones de BSManager.", diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 3a74144f..aec4f0dc 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -446,10 +446,16 @@ "label": "Rester connecté" } }, + "why-credentials": "Pourquoi mes identifiants sont nécessaires ?", "buttons": { "submit": "Se connecter" } }, + "steam-credentials":{ + "title": "Steam Credentials", + "p-1": "Les informations d'identification ne sont utilisées que pour télécharger le jeu, car Steam doit vérifier que vous avez payé le jeu afin d'être autorisé à le télécharger. Ils ne sont pas sauvegardés et transmis directement à DepotDownloader. Si vous ne voulez pas entrer vos informations d'identification, vous pouvez suivre ce tutoriel :", + "p-2": "puis cliquez sur l'icône de l'engrenage dans le coin supérieur droit et sélectionnez \"Importer une version\", sélectionnez le dossier où beat saber a été téléchargé (Si vous suivez le tutoriel ci-dessus, vous devriez avoir le bon emplacement)." + }, "bs-import-version":{ "title": "Importer une version", "description": "Importe une version de BeatSaber pour profiter des fonctionnalités de BSManager. L'importation copiera le dossier d'installation de BeatSaber sélectionné dans le dossier de versions de BSManager.", diff --git a/src/renderer/components/modal/modal-types/login-modal.component.tsx b/src/renderer/components/modal/modal-types/login-modal.component.tsx index 87e01e1d..b252cd96 100644 --- a/src/renderer/components/modal/modal-types/login-modal.component.tsx +++ b/src/renderer/components/modal/modal-types/login-modal.component.tsx @@ -2,11 +2,14 @@ import { useState } from "react"; import { BsmButton } from "renderer/components/shared/bsm-button.component"; import { BsmImage } from "renderer/components/shared/bsm-image.component"; import { useTranslation } from "renderer/hooks/use-translation.hook"; -import { ModalComponent, ModalExitCode } from "renderer/services/modale.service"; +import { ModalComponent, ModalExitCode, ModalService } from "renderer/services/modale.service"; import BeatImpatient from '../../../../../assets/images/apngs/beat-impatient.png' +import { WhyCredentialsModal } from "./why-credentials-modal.component"; export const LoginModal: ModalComponent<{username: string, password: string, stay: boolean}> = ({resolver}) => { + const modal = ModalService.getInsance(); + const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [stay, setStay] = useState(true); @@ -17,10 +20,15 @@ export const LoginModal: ModalComponent<{username: string, password: string, sta resolver({exitCode: ModalExitCode.COMPLETED, data:{username, password, stay}}); } + const whyCredentials = () => { + modal.openModal(WhyCredentialsModal); + } + return (
{e.preventDefault(); loggin();}}>

{t("modals.steam-login.title")}

+
setUsername(e.target.value)} value={username} type="text" name="username" id="username" placeholder={t("modals.steam-login.inputs.username.placeholder")}/> @@ -29,10 +37,9 @@ export const LoginModal: ModalComponent<{username: string, password: string, sta setPassword(e.target.value)} value={password} type="password" name="password" id="password" placeholder={t("modals.steam-login.inputs.password.placeholder")}/>
-
- setStay(e.target.checked)} checked={stay} className="mr-1" type="checkbox" name="stay" id="stay" /> - -
+ + {t("modals.steam-login.why-credentials")} +
{resolver({exitCode: ModalExitCode.CANCELED})}} withBar={false} text="misc.cancel"/> diff --git a/src/renderer/components/modal/modal-types/why-credentials-modal.component.tsx b/src/renderer/components/modal/modal-types/why-credentials-modal.component.tsx new file mode 100644 index 00000000..b7afa9b9 --- /dev/null +++ b/src/renderer/components/modal/modal-types/why-credentials-modal.component.tsx @@ -0,0 +1,26 @@ +import { BsmButton } from "renderer/components/shared/bsm-button.component"; +import { useTranslation } from "renderer/hooks/use-translation.hook"; +import { LinkOpenerService } from "renderer/services/link-opener.service"; +import { ModalComponent, ModalExitCode } from "renderer/services/modale.service" + +export const WhyCredentialsModal: ModalComponent = ({resolver}) => { + + const t = useTranslation(); + const linkOpener = LinkOpenerService.getInstance(); + + const openTutorial = () => { + linkOpener.open("https://steamcommunity.com/sharedfiles/filedetails/?id=1805934840"); + } + + return ( + +

{t("modals.steam-credentials.title")}

+ +

{t("modals.steam-credentials.p-1")}

+ {e.preventDefault; openTutorial()}} className="underline text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-600 mb-2 block cursor-pointer"> + https://steamcommunity.com/sharedfiles/filedetails/?id=1805934840 + +

{t("modals.steam-credentials.p-2")}

+ + ) +}