diff --git a/apps/web/src/features/settings/authentication/components/password.tsx b/apps/web/src/features/settings/authentication/components/password.tsx index 73f90406c..fc6628011 100644 --- a/apps/web/src/features/settings/authentication/components/password.tsx +++ b/apps/web/src/features/settings/authentication/components/password.tsx @@ -3,11 +3,24 @@ import { PasswordIcon, PencilSimpleLineIcon } from "@phosphor-icons/react"; import { Link, useNavigate } from "@tanstack/react-router"; import { m } from "motion/react"; import { useCallback } from "react"; -import { match } from "ts-pattern"; import { Button } from "@reactive-resume/ui/components/button"; import { useDialogStore } from "@/dialogs/store"; import { useAuthAccounts } from "./hooks"; +// ponytail: m.div wrapper is identical for both branches — extracted, match(boolean) removed +function ActionButton({ children }: { children: React.ReactNode }) { + return ( + + {children} + + ); +} + export function PasswordSection() { const navigate = useNavigate(); const { openDialog } = useDialogStore(); @@ -35,39 +48,24 @@ export function PasswordSection() { Password - {match(hasPassword) - .with(true, () => ( - - - - )) - .with(false, () => ( - - + ) : ( + - - )) - .with(false, () => ( - - - - )) - .exhaustive()} + + {isConnected ? ( + + ) : ( + + )} + ); diff --git a/apps/web/src/features/settings/authentication/components/two-factor.tsx b/apps/web/src/features/settings/authentication/components/two-factor.tsx index c534783e2..a977586a6 100644 --- a/apps/web/src/features/settings/authentication/components/two-factor.tsx +++ b/apps/web/src/features/settings/authentication/components/two-factor.tsx @@ -2,13 +2,26 @@ import { Trans } from "@lingui/react/macro"; import { KeyIcon, LockOpenIcon, ToggleLeftIcon, ToggleRightIcon } from "@phosphor-icons/react"; import { m } from "motion/react"; import { useCallback } from "react"; -import { match } from "ts-pattern"; import { Button } from "@reactive-resume/ui/components/button"; import { Separator } from "@reactive-resume/ui/components/separator"; import { useDialogStore } from "@/dialogs/store"; import { authClient } from "@/libs/auth/client"; import { useAuthAccounts } from "./hooks"; +// ponytail: shared hover/tap wrapper — identical in both branches, match(boolean) removed +function ActionButton({ children }: { children: React.ReactNode }) { + return ( + + {children} + + ); +} + export function TwoFactorSection() { const { openDialog } = useDialogStore(); const { hasAccount } = useAuthAccounts(); @@ -42,34 +55,21 @@ export function TwoFactorSection() { Two-Factor Authentication - {match(hasTwoFactor) - .with(true, () => ( - - - - )) - .with(false, () => ( - - - - )) - .exhaustive()} + + )} + + );