Fix & Refactor UI Page [Auth Page]

[+] fix(auth.tsx): fix conditional rendering of token input field
[+] refactor(auth.tsx): improve code readability by using conditional rendering for token input field
This commit is contained in:
H0llyW00dzZ 2023-10-01 00:23:19 +07:00
parent 31e30906d0
commit 04b638aa06
No known key found for this signature in database
GPG Key ID: 05C7FFFC0845C930

View File

@ -43,16 +43,20 @@ export function AuthPage() {
access.updateCode(e.currentTarget.value); access.updateCode(e.currentTarget.value);
}} }}
/> />
<div className={styles["auth-tips"]}>{Locale.Auth.SubTips}</div> {!access.hideUserApiKey ? (
<input <>
className={styles["auth-input"]} <div className={styles["auth-tips"]}>{Locale.Auth.SubTips}</div>
type="password" <input
placeholder={Locale.Settings.Token.Placeholder} className={styles["auth-input"]}
value={access.token} type="password"
onChange={(e) => { placeholder={Locale.Settings.Token.Placeholder}
access.updateToken(e.currentTarget.value); value={access.token}
}} onChange={(e) => {
/> access.updateToken(e.currentTarget.value);
}}
/>
</>
) : null}
<div className={styles["auth-actions"]}> <div className={styles["auth-actions"]}>
<IconButton <IconButton