feat(wizard): move progress stepper to left sidebar

This commit is contained in:
DanielS
2026-08-11 17:26:49 +02:00
parent 7346b42ff3
commit 1478c61ea8
4 changed files with 164 additions and 169 deletions

View File

@@ -844,138 +844,110 @@ export function OrderWizard({
}
return (
<div className={`mx-auto px-4 ${step === 3 ? 'max-w-screen-2xl' : 'max-w-5xl'}`}>
{/* Dynamic Header */}
{step !== 3 && (
<div className="text-center mb-12">
<h1 className="text-5xl font-extrabold tracking-tight mb-4 text-gradient">
Konfigurieren Sie Ihre Lösung
</h1>
<p className="text-slate-400 text-lg max-w-2xl mx-auto">
Wählen Sie das passende Paket und die benötigten Module für Ihr Business.
</p>
<div className="max-w-7xl mx-auto px-4 py-6">
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
{/* Left Side Status Stepper for ALL steps */}
<div className="lg:col-span-3 bg-slate-900/50 backdrop-blur-md border border-white/10 rounded-2xl p-6 space-y-6 sticky top-6">
<div>
<h2 className="text-xs font-bold uppercase tracking-wider text-slate-400 mb-1">
Fortschritt
</h2>
<p className="text-lg font-extrabold text-white">
Bestell-Wizard
</p>
</div>
<ProgressStepper step={step} basketItemsCount={basketItems.length} orientation="vertical" />
</div>
)}
{/* Global Stepper for Steps 1, 2, 4 */}
{step !== 3 && (
<div className="pt-12 pb-6">
<ProgressStepper step={step} basketItemsCount={basketItems.length} />
</div>
)}
{/* Right Main Content Column */}
<div className="lg:col-span-9 space-y-6">
{/* Dynamic Header */}
{step !== 3 && (
<div className="mb-8">
<h1 className="text-4xl font-extrabold tracking-tight mb-2 text-gradient">
Konfigurieren Sie Ihre Lösung
</h1>
<p className="text-slate-400 text-base">
Wählen Sie das passende Paket und die benötigten Module für Ihr Business.
</p>
</div>
)}
<AnimatePresence mode="wait">
{/* Step 1: Customer */}
{step === 1 && (
<motion.div
key="step1"
initial={{ opacity: 0, x: 20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
className="space-y-6"
>
<StepCustomer
isAdmin={isAdmin}
companies={companies}
selectedCompanyId={selectedCompanyId}
setSelectedCompanyId={setSelectedCompanyId}
customerMode={customerMode}
setCustomerMode={setCustomerMode}
endCustomers={endCustomers}
searchTerm={searchTerm}
setSearchTerm={setSearchTerm}
filteredEndCustomers={filteredEndCustomers}
selectedEndCustomerId={selectedEndCustomerId}
setSelectedEndCustomerId={setSelectedEndCustomerId}
newCustomerForm={newCustomerForm}
setNewCustomerForm={setNewCustomerForm}
handleCreateCustomer={handleCreateCustomer}
isCreatingCustomer={isCreatingCustomer}
nextStep={nextStep}
/>
</motion.div>
)}
<AnimatePresence mode="wait">
{/* Step 1: Customer */}
{step === 1 && (
<motion.div
key="step1"
initial={{ opacity: 0, x: 20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
className="space-y-6"
>
<StepCustomer
isAdmin={isAdmin}
companies={companies}
selectedCompanyId={selectedCompanyId}
setSelectedCompanyId={setSelectedCompanyId}
customerMode={customerMode}
setCustomerMode={setCustomerMode}
endCustomers={endCustomers}
searchTerm={searchTerm}
setSearchTerm={setSearchTerm}
filteredEndCustomers={filteredEndCustomers}
selectedEndCustomerId={selectedEndCustomerId}
setSelectedEndCustomerId={setSelectedEndCustomerId}
newCustomerForm={newCustomerForm}
setNewCustomerForm={setNewCustomerForm}
handleCreateCustomer={handleCreateCustomer}
isCreatingCustomer={isCreatingCustomer}
nextStep={nextStep}
/>
</motion.div>
)}
{/* Step 2: Billing Model */}
{step === 2 && (
<motion.div
key="step2"
initial={{ opacity: 0, x: 20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
className="space-y-6"
>
<StepBilling
selectedBillingInterval={selectedBillingInterval}
handleBillingIntervalChange={handleBillingIntervalChange}
customerMode={customerMode}
selectedEndCustomerId={selectedEndCustomerId}
lastLicenseDate={lastLicenseDate}
setLastLicenseDate={setLastLicenseDate}
prevStep={prevStep}
nextStep={nextStep}
/>
</motion.div>
)}
{/* Step 3: Software Selector */}
{/* Step 2: Billing Model */}
{step === 2 && (
<motion.div
key="step2"
initial={{ opacity: 0, x: 20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
className="space-y-6"
>
<StepBilling
selectedBillingInterval={selectedBillingInterval}
handleBillingIntervalChange={handleBillingIntervalChange}
customerMode={customerMode}
selectedEndCustomerId={selectedEndCustomerId}
lastLicenseDate={lastLicenseDate}
setLastLicenseDate={setLastLicenseDate}
prevStep={prevStep}
nextStep={nextStep}
/>
</motion.div>
)}
{step === 3 && (
<motion.div
key="step3"
initial={{ opacity: 0, x: 20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
className="h-[calc(100vh-140px)] overflow-hidden"
className="h-[calc(100vh-100px)] overflow-hidden"
>
<div className="grid grid-cols-1 lg:grid-cols-6 gap-6 h-full items-stretch">
{/* LEFT: Categories Sidebar Menu */}
<div className="lg:col-span-2 flex flex-col justify-start pr-4 space-y-6">
<div>
<h1 className="text-3xl font-extrabold tracking-tight mb-2 text-gradient">
Konfigurieren Sie Ihre Lösung
</h1>
<p className="text-slate-400 text-sm">
Wählen Sie das passende Paket und die benötigten Module für Ihr Business.
</p>
</div>
{/* LEFT inside step 3: Categories Sidebar Menu */}
<div className="lg:col-span-2 flex flex-col justify-start pr-4 space-y-4 overflow-y-auto">
<div>
<h1 className="text-xl font-extrabold tracking-tight mb-1 text-gradient">
Kategorien & Optionen
</h1>
<p className="text-slate-400 text-xs">
Wählen Sie das passende Paket und die benötigten Module für Ihr Business.
</p>
</div>
{/* Left Sidebar Status Stepper (matching ProgressStepper sky-blue design) */}
<div className="space-y-2 py-4 border-t border-b border-white/5">
<p className="text-xs font-bold uppercase tracking-wider text-slate-500">
Status
</p>
<div className="flex flex-row flex-wrap items-center gap-x-3 gap-y-2 pl-1">
<div className="flex items-center gap-1.5">
<div className="w-6 h-6 rounded-full bg-sky-500 border-2 border-sky-400 flex items-center justify-center shadow-[0_0_10px_rgba(56,189,248,0.4)]">
<Check className="w-3.5 h-3.5 text-slate-950 stroke-[3]" />
</div>
<span className="text-xs text-sky-300 font-semibold">Kunde</span>
</div>
<div className="w-6 h-[2px] bg-gradient-to-r from-sky-500 to-sky-400 rounded-full shadow-[0_0_6px_rgba(56,189,248,0.5)]" />
<div className="flex items-center gap-1.5">
<div className="w-6 h-6 rounded-full bg-sky-500 border-2 border-sky-400 flex items-center justify-center shadow-[0_0_10px_rgba(56,189,248,0.4)]">
<Check className="w-3.5 h-3.5 text-slate-950 stroke-[3]" />
</div>
<span className="text-xs text-sky-300 font-semibold">Modell</span>
</div>
<div className="w-6 h-[2px] bg-gradient-to-r from-sky-500 to-sky-400 rounded-full shadow-[0_0_6px_rgba(56,189,248,0.5)]" />
<div className="flex items-center gap-1.5">
<div className="w-6 h-6 rounded-full bg-slate-950 border-2 border-sky-400 text-sky-400 flex items-center justify-center text-xs font-bold shadow-[0_0_15px_rgba(56,189,248,0.5)]">
3
</div>
<span className="text-xs text-sky-300 font-bold">Software</span>
</div>
<div className="w-6 h-[2px] bg-slate-800 rounded-full" />
<div className="flex items-center gap-1.5">
<div className="w-6 h-6 rounded-full bg-slate-900 border-2 border-slate-800 text-slate-500 flex items-center justify-center text-xs">
4
</div>
<span className="text-xs text-slate-500 font-medium">Abschluss</span>
</div>
</div>
</div>
<div className="flex flex-col gap-2">
<div className="flex flex-col gap-2">
{visibleCategories.map((cat) => {
const sel = selections[cat.id]
const hasSelection = (sel?.productIds && sel.productIds.length > 0) || !!sel?.productId
@@ -1059,9 +1031,8 @@ export function OrderWizard({
</div>
</div>
{/* RIGHT: Stepper Header + Summary sidebar */}
<div className="lg:col-span-2 flex flex-col h-full overflow-hidden pl-4">
{/* RIGHT: Summary sidebar */}
<div className="lg:col-span-2 flex flex-col h-full overflow-hidden pl-2">
<div className="flex-1 overflow-hidden">
<SummarySidebar
visibleCategories={visibleCategories}
@@ -1143,6 +1114,8 @@ export function OrderWizard({
{/* Toast Notification Container */}
<ToastNotification toast={toast} onClose={() => setToast(null)} />
</div>
</div>
</div>
)
}