Skip to content

Commit

Permalink
Fix & Refactor UI Page [Auth Page]
Browse files Browse the repository at this point in the history
[+] fix(auth.tsx): fix conditional rendering of token input field
[+] refactor(auth.tsx): improve code readability by using conditional rendering for token input field
  • Loading branch information
H0llyW00dzZ committed Sep 30, 2023
1 parent 31e3090 commit 04b638a
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions app/components/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,20 @@ export function AuthPage() {
access.updateCode(e.currentTarget.value);
}}
/>
<div className={styles["auth-tips"]}>{Locale.Auth.SubTips}</div>
<input
className={styles["auth-input"]}
type="password"
placeholder={Locale.Settings.Token.Placeholder}
value={access.token}
onChange={(e) => {
access.updateToken(e.currentTarget.value);
}}
/>
{!access.hideUserApiKey ? (
<>
<div className={styles["auth-tips"]}>{Locale.Auth.SubTips}</div>
<input
className={styles["auth-input"]}
type="password"
placeholder={Locale.Settings.Token.Placeholder}
value={access.token}
onChange={(e) => {
access.updateToken(e.currentTarget.value);
}}
/>
</>
) : null}

<div className={styles["auth-actions"]}>
<IconButton
Expand Down

0 comments on commit 04b638a

Please sign in to comment.