feat: Hide tutorial on login, add 'Angemeldet bleiben' checkbox

- OnboardingTutorial: Skip on /login, /auth, /register paths
- AuthForm: Added remember-me checkbox (default: checked)
- Session persistence based on checkbox selection
This commit is contained in:
2025-12-26 22:46:22 +01:00
parent 1017ec2c57
commit 73a057b1e3
3 changed files with 56 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
'use client';
import { useState, useEffect } from 'react';
import { usePathname } from 'next/navigation';
import { motion, AnimatePresence } from 'framer-motion';
import { Scan, GlassWater, Users, Settings, ArrowRight, X, Sparkles } from 'lucide-react';
@@ -49,8 +50,14 @@ const STEPS: OnboardingStep[] = [
export default function OnboardingTutorial() {
const [isOpen, setIsOpen] = useState(false);
const [currentStep, setCurrentStep] = useState(0);
const pathname = usePathname();
useEffect(() => {
// Don't show on login/auth pages
if (pathname === '/login' || pathname === '/auth' || pathname === '/register') {
return;
}
// Check if onboarding was completed
const completed = localStorage.getItem(ONBOARDING_KEY);
if (!completed) {
@@ -58,7 +65,7 @@ export default function OnboardingTutorial() {
const timer = setTimeout(() => setIsOpen(true), 1000);
return () => clearTimeout(timer);
}
}, []);
}, [pathname]);
const handleNext = () => {
if (currentStep < STEPS.length - 1) {
@@ -125,10 +132,10 @@ export default function OnboardingTutorial() {
<div
key={index}
className={`w-2 h-2 rounded-full transition-all ${index === currentStep
? 'w-6 bg-orange-500'
: index < currentStep
? 'bg-orange-500/50'
: 'bg-zinc-700'
? 'w-6 bg-orange-500'
: index < currentStep
? 'bg-orange-500/50'
: 'bg-zinc-700'
}`}
/>
))}