From c98dc31cdfd8bb92d11cc19cb577cb4d99356a72 Mon Sep 17 00:00:00 2001 From: code-october <148516338+code-october@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:03:20 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E7=A0=81=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/auth.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/components/auth.tsx b/app/components/auth.tsx index e19512d87..6c5e75d79 100644 --- a/app/components/auth.tsx +++ b/app/components/auth.tsx @@ -11,6 +11,7 @@ import Logo from "../icons/logo.svg"; import { useMobileScreen } from "@/app/utils"; import BotIcon from "../icons/bot.svg"; import { getClientConfig } from "../config/client"; +import { PasswordInput } from "./ui-lib"; import LeftIcon from "@/app/icons/left.svg"; import { safeLocalStorage } from "@/app/utils"; import { @@ -60,17 +61,20 @@ export function AuthPage() { <div className={styles["auth-title"]}>{Locale.Auth.Title}</div> <div className={styles["auth-tips"]}>{Locale.Auth.Tips}</div> - <input - className={styles["auth-input"]} - type="password" - placeholder={Locale.Auth.Input} + <PasswordInput + style={{ marginTop: "3vh", marginBottom: "3vh" }} + aria={Locale.Settings.ShowPassword} + aria-label={Locale.Auth.Input} value={accessStore.accessCode} + type="text" + placeholder={Locale.Auth.Input} onChange={(e) => { accessStore.update( (access) => (access.accessCode = e.currentTarget.value), ); }} /> + {!accessStore.hideUserApiKey ? ( <> <div className={styles["auth-tips"]}>{Locale.Auth.SubTips}</div> From 4a7fd3a3803b229f6ecaeea03a0589017130470c Mon Sep 17 00:00:00 2001 From: code-october <148516338+code-october@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:36:11 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=20api?= =?UTF-8?q?=20=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/auth.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/components/auth.tsx b/app/components/auth.tsx index 6c5e75d79..539a52eec 100644 --- a/app/components/auth.tsx +++ b/app/components/auth.tsx @@ -78,22 +78,26 @@ export function AuthPage() { {!accessStore.hideUserApiKey ? ( <> <div className={styles["auth-tips"]}>{Locale.Auth.SubTips}</div> - <input - className={styles["auth-input"]} - type="password" - placeholder={Locale.Settings.Access.OpenAI.ApiKey.Placeholder} + <PasswordInput + style={{ marginTop: "3vh", marginBottom: "3vh" }} + aria={Locale.Settings.ShowPassword} + aria-label={Locale.Settings.Access.OpenAI.ApiKey.Placeholder} value={accessStore.openaiApiKey} + type="text" + placeholder={Locale.Settings.Access.OpenAI.ApiKey.Placeholder} onChange={(e) => { accessStore.update( (access) => (access.openaiApiKey = e.currentTarget.value), ); }} /> - <input - className={styles["auth-input-second"]} - type="password" - placeholder={Locale.Settings.Access.Google.ApiKey.Placeholder} + <PasswordInput + style={{ marginTop: "3vh", marginBottom: "3vh" }} + aria={Locale.Settings.ShowPassword} + aria-label={Locale.Settings.Access.Google.ApiKey.Placeholder} value={accessStore.googleApiKey} + type="text" + placeholder={Locale.Settings.Access.Google.ApiKey.Placeholder} onChange={(e) => { accessStore.update( (access) => (access.googleApiKey = e.currentTarget.value),