From b34533b242c9b56d0057026839458dc25ce58839 Mon Sep 17 00:00:00 2001 From: chenhang Date: Wed, 17 Jun 2026 16:58:24 +0800 Subject: [PATCH] refactor(auth): use icon library for provider icons --- package.json | 5 +- pnpm-lock.yaml | 12 +++++ .../auth/components/auth-facebook-panel.tsx | 5 +- .../components/auth-other-options-dialog.tsx | 47 ++----------------- src/app/auth/components/auth-panel.tsx | 15 +----- .../auth/components/auth-provider-icon.tsx | 35 ++++++++++++++ .../auth/components/auth-social-buttons.tsx | 30 ++---------- src/app/auth/components/index.ts | 1 + 8 files changed, 64 insertions(+), 86 deletions(-) create mode 100644 src/app/auth/components/auth-provider-icon.tsx diff --git a/package.json b/package.json index 58963f48..78ebce55 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "pino": "^10.3.1", "react": "19.2.4", "react-dom": "19.2.4", + "react-icons": "^5.6.0", "stripe": "^22.2.1", "unstorage": "^1.17.5", "xstate": "^5", @@ -36,8 +37,6 @@ }, "devDependencies": { "@serwist/turbopack": "^9.0.0", - "esbuild": "^0.25.0", - "serwist": "^9.0.0", "@tailwindcss/postcss": "^4", "@types/node": "^20", "@types/react": "^19", @@ -45,9 +44,11 @@ "@vitest/coverage-v8": "^4.1.8", "@vitest/ui": "^4.1.8", "barrelsby": "^2.8.1", + "esbuild": "^0.25.0", "eslint": "^9", "eslint-config-next": "16.2.7", "jsdom": "^29.1.1", + "serwist": "^9.0.0", "tailwindcss": "^4", "typescript": "^5", "vitest": "^4.1.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ca08180..57fde0b2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,6 +47,9 @@ importers: react-dom: specifier: 19.2.4 version: 19.2.4(react@19.2.4) + react-icons: + specifier: ^5.6.0 + version: 5.6.0(react@19.2.4) stripe: specifier: ^22.2.1 version: 22.2.1(@types/node@20.19.41) @@ -2698,6 +2701,11 @@ packages: peerDependencies: react: ^19.2.4 + react-icons@5.6.0: + resolution: {integrity: sha512-RH93p5ki6LfOiIt0UtDyNg/cee+HLVR6cHHtW3wALfo+eOHTp8RnU2kRkI6E+H19zMIs03DyxUG/GfZMOGvmiA==} + peerDependencies: + react: '*' + react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -5890,6 +5898,10 @@ snapshots: react: 19.2.4 scheduler: 0.27.0 + react-icons@5.6.0(react@19.2.4): + dependencies: + react: 19.2.4 + react-is@16.13.1: {} react@19.2.4: {} diff --git a/src/app/auth/components/auth-facebook-panel.tsx b/src/app/auth/components/auth-facebook-panel.tsx index 6f3e8e1f..830f55f2 100644 --- a/src/app/auth/components/auth-facebook-panel.tsx +++ b/src/app/auth/components/auth-facebook-panel.tsx @@ -21,6 +21,7 @@ import { useAuthDispatch, useAuthState } from "@/stores/auth/auth-context"; import { AuthErrorMessage } from "./auth-error-message"; import { AuthLegalText } from "./auth-legal-text"; import { AuthOtherOptionsDialog } from "./auth-other-options-dialog"; +import { AuthProviderIcon } from "./auth-provider-icon"; import styles from "./auth-facebook-panel.module.css"; export interface AuthFacebookPanelProps { @@ -70,9 +71,7 @@ export function AuthFacebookPanel({ onSwitchToEmail }: AuthFacebookPanelProps) {