From 57cf32ac18a13f3bae13d5685f566bb3e955d726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Wed, 10 Jun 2026 09:26:22 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=AE=BE=E7=BD=AE=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=A0=87=E9=A2=98=E4=B8=8E=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E6=94=B9=E4=B8=BA=E5=90=8C=E8=A1=8C=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 标签左对齐(60px 宽度),输入框右侧自适应 - 错误提示也跟随缩进对齐 --- .../src/components/Modal/SetPasswordModal.tsx | 206 ++++++++++-------- 1 file changed, 112 insertions(+), 94 deletions(-) diff --git a/tauri-app/src/components/Modal/SetPasswordModal.tsx b/tauri-app/src/components/Modal/SetPasswordModal.tsx index aaa3d4b..40a8a46 100644 --- a/tauri-app/src/components/Modal/SetPasswordModal.tsx +++ b/tauri-app/src/components/Modal/SetPasswordModal.tsx @@ -95,12 +95,24 @@ export default function SetPasswordModal({ marginBottom: '16px', }; - const labelStyle: React.CSSProperties = { - display: 'block', + const rowStyle: React.CSSProperties = { + display: 'flex', + alignItems: 'center', + gap: '12px', + }; + + const rowLabelStyle: React.CSSProperties = { fontSize: '13px', fontWeight: 500, color: 'var(--text-secondary)', - marginBottom: '6px', + width: '60px', + flexShrink: 0, + textAlign: 'right', + }; + + const rowInputWrapStyle: React.CSSProperties = { + flex: 1, + position: 'relative', }; const errorStyle: React.CSSProperties = { @@ -153,18 +165,65 @@ export default function SetPasswordModal({
{hasPassword && (
- -
+
+ +
+ setOldPassword(e.target.value)} + style={inputStyle} + onKeyDown={e => { if (e.key === 'Enter') handleSubmit(); }} + /> + +
+
+
+
+ )} + +
+
+ +
setOldPassword(e.target.value)} + type={showNew ? 'text' : 'password'} + placeholder="至少6位字符" + value={newPassword} + onChange={e => setNewPassword(e.target.value)} style={inputStyle} onKeyDown={e => { if (e.key === 'Enter') handleSubmit(); }} />
-
- )} - -
- -
- setNewPassword(e.target.value)} - style={inputStyle} - onKeyDown={e => { if (e.key === 'Enter') handleSubmit(); }} - /> - -
-
{pwdTooShort ? '密码至少需要6位' : ''}
+
{pwdTooShort ? '密码至少需要6位' : ''}
- -
- setConfirmPassword(e.target.value)} - style={inputStyle} - onKeyDown={e => { if (e.key === 'Enter') handleSubmit(); }} - /> - +
+ +
+ setConfirmPassword(e.target.value)} + style={inputStyle} + onKeyDown={e => { if (e.key === 'Enter') handleSubmit(); }} + /> + +
-
{pwdMismatch ? '两次输入的密码不一致' : ''}
+
{pwdMismatch ? '两次输入的密码不一致' : ''}