From b11f0109383f41616a9dc714e9f1c7d221faf485 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Sat, 24 Jan 2026 09:50:06 +0100 Subject: [PATCH] refactor(checkout): wrap auth step buttons in shadcn tabs --- .../marketing/checkout/steps/AuthStep.tsx | 149 +++++++++--------- 1 file changed, 77 insertions(+), 72 deletions(-) diff --git a/resources/js/pages/marketing/checkout/steps/AuthStep.tsx b/resources/js/pages/marketing/checkout/steps/AuthStep.tsx index 340db59..2dd75b8 100644 --- a/resources/js/pages/marketing/checkout/steps/AuthStep.tsx +++ b/resources/js/pages/marketing/checkout/steps/AuthStep.tsx @@ -2,6 +2,8 @@ import React, { useCallback, useEffect, useMemo, useState } from "react"; import { usePage } from "@inertiajs/react"; import { Button } from "@/components/ui/button"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Card, CardContent } from "@/components/ui/card"; import { useCheckoutWizard } from "../WizardContext"; import type { OAuthProfilePrefill } from '../types'; import LoginForm, { AuthUserPayload } from "../../../auth/LoginForm"; @@ -62,7 +64,6 @@ export const AuthStep: React.FC = ({ privacyHtml, prefill, onClea const [mode, setMode] = useState<'login' | 'register'>('register'); const [isRedirectingToGoogle, setIsRedirectingToGoogle] = useState(false); const [isRedirectingToFacebook, setIsRedirectingToFacebook] = useState(false); - const showOauthControls = mode === 'register'; const authErrorTitle = facebookAuth?.error ? t('checkout.auth_step.facebook_error_title') : t('checkout.auth_step.google_error_title'); @@ -181,80 +182,84 @@ export const AuthStep: React.FC = ({ privacyHtml, prefill, onClea return (
-
-
- - - {showOauthControls && ( -
- - -
+ setMode(v as 'login' | 'register')} className="w-full"> + + {t('checkout.auth_step.switch_to_register')} + {t('checkout.auth_step.switch_to_login')} + + + + {(googleAuth?.error || facebookAuth?.error) && ( + + {authErrorTitle} + {facebookAuth?.error ?? googleAuth?.error} + )} -
-
- {(googleAuth?.error || facebookAuth?.error) && ( - - {authErrorTitle} - {facebookAuth?.error ?? googleAuth?.error} - - )} + + +
+
+ + +
+
+
+
-
- {mode === 'register' ? ( - selectedPackage && ( - - ) - ) : ( - - )} -
+ {selectedPackage && ( + + )} +
+
+ + + + + + + + + +
); };