浏览代码

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
H0llyW00dzZ 1 年之前
父节点
当前提交
04b638aa06
共有 1 个文件被更改,包括 14 次插入10 次删除
  1. 14 10
      app/components/auth.tsx

+ 14 - 10
app/components/auth.tsx

@@ -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