Skip to content

Commit 2262ebd

Browse files
author
root
committed
refactor: adopt button in login page
1 parent 17142b7 commit 2262ebd

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

packages/web/src/components/ui/MIGRATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Component | Status | Legacy classes | Callers left | Last update |
44
|---|---|---|---:|---|
5-
| Button | ⚫ not-started | `.btn .btn-*` | 31 | 2026-05-06 |
5+
| Button | 🟡 in-flight | `.btn .btn-*` | 30 | 2026-05-06 |
66
| IconButton | ⚫ not-started | `.btn` icon-only |||
77
| Input | ⚫ not-started | `.input` |||
88
| Textarea | ⚫ not-started | `.input.textarea` |||

packages/web/src/components/ui/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
- PC / 移动差异默认由 token 或共享内部逻辑解决,业务代码不直接写 `matchMedia`
88

99
## 已实现组件
10-
当前 phase 只会先落 `Button`。公共导出完成后,这里会改成可用组件列表。
10+
| Component | Tier | Public API | Notes |
11+
|---|---|---|---|
12+
| Button | 0 | `src/components/ui/index.ts` named export only | `primary / secondary / ghost / danger` × `sm / md / lg` |
1113

1214
## 迁移状态
1315
`./MIGRATION.md`

packages/web/src/features/auth/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useAtom, useAtomValue } from "jotai";
22
import { useEffect, useState } from "react";
33
import { authenticatedAtom, localeAtom } from "../../atoms/app-ui";
44
import { authEnabledAtom } from "../../atoms/connection";
5+
import { Button } from "../../components/ui";
56
import { useViewport } from "../../hooks/use-viewport";
67
import { formatDate, useTranslation } from "../../lib/i18n";
78

@@ -157,13 +158,15 @@ export function LoginPage() {
157158
onChange={(e) => setPassword(e.target.value)}
158159
placeholder={t("settings.auth.password")}
159160
/>
160-
<button
161-
className="btn btn-primary btn-lg auth-submit"
161+
<Button
162+
className="auth-submit"
163+
variant="primary"
164+
size="lg"
162165
type="submit"
163166
disabled={checkingStatus || submitting || !password.trim()}
164167
>
165168
{submitLabel}
166-
</button>
169+
</Button>
167170
</form>
168171
</div>
169172
</div>

0 commit comments

Comments
 (0)