feat(wizard): add directional slide animations
This commit is contained in:
@@ -94,6 +94,7 @@ export function OrderWizard({
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
// Upgrade-Mode: starte direkt bei Schritt 3 (Software)
|
// Upgrade-Mode: starte direkt bei Schritt 3 (Software)
|
||||||
const [step, setStep] = useState(upgradeMode ? 3 : (initialOrder ? 3 : 1))
|
const [step, setStep] = useState(upgradeMode ? 3 : (initialOrder ? 3 : 1))
|
||||||
|
const [direction, setDirection] = useState(1)
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||||
const [selectedCompanyId, setSelectedCompanyId] = useState<string | null>(
|
const [selectedCompanyId, setSelectedCompanyId] = useState<string | null>(
|
||||||
initialOrder?.company_id ?? (isAdmin ? 'all' : null)
|
initialOrder?.company_id ?? (isAdmin ? 'all' : null)
|
||||||
@@ -543,10 +544,12 @@ export function OrderWizard({
|
|||||||
addToBasket()
|
addToBasket()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setDirection(1)
|
||||||
setStep(s => s + 1)
|
setStep(s => s + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const prevStep = () => {
|
const prevStep = () => {
|
||||||
|
setDirection(-1)
|
||||||
setStep(s => s - 1)
|
setStep(s => s - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,7 +851,7 @@ export function OrderWizard({
|
|||||||
{/* Dynamic Header */}
|
{/* Dynamic Header */}
|
||||||
{step !== 3 && (
|
{step !== 3 && (
|
||||||
<div className="text-center mb-12">
|
<div className="text-center mb-12">
|
||||||
<h1 className="text-5xl font-extrabold tracking-tight mb-4 text-gradient">
|
<h1 className="text-5xl font-extrabold tracking-tight mb-4 text-white">
|
||||||
Konfigurieren Sie Ihre Lösung
|
Konfigurieren Sie Ihre Lösung
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-slate-400 text-lg max-w-2xl mx-auto">
|
<p className="text-slate-400 text-lg max-w-2xl mx-auto">
|
||||||
@@ -869,9 +872,9 @@ export function OrderWizard({
|
|||||||
{step === 1 && (
|
{step === 1 && (
|
||||||
<motion.div
|
<motion.div
|
||||||
key="step1"
|
key="step1"
|
||||||
initial={{ opacity: 0, x: 20 }}
|
initial={{ opacity: 0, y: direction * 20 }}
|
||||||
animate={{ opacity: 1, x: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
exit={{ opacity: 0, x: -20 }}
|
exit={{ opacity: 0, y: direction * -20 }}
|
||||||
className="space-y-6"
|
className="space-y-6"
|
||||||
>
|
>
|
||||||
<StepCustomer
|
<StepCustomer
|
||||||
@@ -900,9 +903,9 @@ export function OrderWizard({
|
|||||||
{step === 2 && (
|
{step === 2 && (
|
||||||
<motion.div
|
<motion.div
|
||||||
key="step2"
|
key="step2"
|
||||||
initial={{ opacity: 0, x: 20 }}
|
initial={{ opacity: 0, y: direction * 20 }}
|
||||||
animate={{ opacity: 1, x: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
exit={{ opacity: 0, x: -20 }}
|
exit={{ opacity: 0, y: direction * -20 }}
|
||||||
className="space-y-6"
|
className="space-y-6"
|
||||||
>
|
>
|
||||||
<StepBilling
|
<StepBilling
|
||||||
@@ -921,9 +924,9 @@ export function OrderWizard({
|
|||||||
{step === 3 && (
|
{step === 3 && (
|
||||||
<motion.div
|
<motion.div
|
||||||
key="step3"
|
key="step3"
|
||||||
initial={{ opacity: 0, x: 20 }}
|
initial={{ opacity: 0, y: direction * 20 }}
|
||||||
animate={{ opacity: 1, x: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
exit={{ opacity: 0, x: -20 }}
|
exit={{ opacity: 0, y: direction * -20 }}
|
||||||
className="h-[calc(100vh-140px)] overflow-hidden"
|
className="h-[calc(100vh-140px)] overflow-hidden"
|
||||||
>
|
>
|
||||||
<div className="grid grid-cols-1 lg:grid-cols-6 gap-6 h-full items-stretch">
|
<div className="grid grid-cols-1 lg:grid-cols-6 gap-6 h-full items-stretch">
|
||||||
@@ -931,7 +934,7 @@ export function OrderWizard({
|
|||||||
{/* LEFT: Categories Sidebar Menu */}
|
{/* LEFT: Categories Sidebar Menu */}
|
||||||
<div className="lg:col-span-2 flex flex-col justify-start pr-4 space-y-6">
|
<div className="lg:col-span-2 flex flex-col justify-start pr-4 space-y-6">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-3xl font-extrabold tracking-tight mb-2 text-gradient">
|
<h1 className="text-3xl font-extrabold tracking-tight mb-2 text-white">
|
||||||
Konfigurieren Sie Ihre Lösung
|
Konfigurieren Sie Ihre Lösung
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-slate-400 text-sm">
|
<p className="text-slate-400 text-sm">
|
||||||
@@ -1108,9 +1111,9 @@ export function OrderWizard({
|
|||||||
{step === 4 && (
|
{step === 4 && (
|
||||||
<motion.div
|
<motion.div
|
||||||
key="step4"
|
key="step4"
|
||||||
initial={{ opacity: 0, scale: 0.98 }}
|
initial={{ opacity: 0, y: direction * 20 }}
|
||||||
animate={{ opacity: 1, scale: 1 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
exit={{ opacity: 0, scale: 0.98 }}
|
exit={{ opacity: 0, y: direction * -20 }}
|
||||||
className="h-[calc(100vh-140px)] overflow-hidden w-full"
|
className="h-[calc(100vh-140px)] overflow-hidden w-full"
|
||||||
>
|
>
|
||||||
<StepSummary
|
<StepSummary
|
||||||
|
|||||||
Reference in New Issue
Block a user