website refactor

This commit is contained in:
2026-01-14 10:51:05 +01:00
parent 4522d41aef
commit 0d89ad027e
291 changed files with 6887 additions and 3685 deletions

View File

@@ -1,7 +1,6 @@
'use client';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { motion, useReducedMotion } from 'framer-motion';
import Card from '@/components/ui/Card';
import Button from '@/components/ui/Button';
@@ -10,14 +9,14 @@ import SponsorHero from '@/components/sponsors/SponsorHero';
import SponsorWorkflowMockup from '@/components/sponsors/SponsorWorkflowMockup';
import SponsorBenefitCard from '@/components/sponsors/SponsorBenefitCard';
import { siteConfig } from '@/lib/siteConfig';
import {
Building2,
Mail,
Globe,
Upload,
Eye,
TrendingUp,
Users,
import {
Building2,
Mail,
Globe,
Upload,
Eye,
TrendingUp,
Users,
ArrowRight,
Trophy,
Car,
@@ -123,7 +122,6 @@ const PLATFORM_STATS = [
];
export default function SponsorSignupPage() {
const router = useRouter();
const shouldReduceMotion = useReducedMotion();
const [mode, setMode] = useState<'landing' | 'signup' | 'login'>('landing');
const [formData, setFormData] = useState({
@@ -183,8 +181,8 @@ export default function SponsorSignupPage() {
setSubmitting(true);
try {
// Create a sponsor account using the normal signup flow
// The backend will handle creating the sponsor user with the appropriate role
// Note: Business logic for auth should be moved to a mutation
// This is a temporary implementation for contract compliance
const response = await fetch('/api/auth/signup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -192,7 +190,6 @@ export default function SponsorSignupPage() {
email: formData.contactEmail,
password: formData.password,
displayName: formData.companyName,
// Additional sponsor-specific data
sponsorData: {
companyName: formData.companyName,
websiteUrl: formData.websiteUrl,
@@ -206,7 +203,6 @@ export default function SponsorSignupPage() {
throw new Error(errorData.message || 'Signup failed');
}
// Auto-login after successful signup
const loginResponse = await fetch('/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -220,7 +216,8 @@ export default function SponsorSignupPage() {
throw new Error('Auto-login failed');
}
router.push('/sponsor/dashboard');
// Navigate to dashboard
window.location.href = '/sponsor/dashboard';
} catch (err) {
console.error('Sponsor signup failed:', err);
alert('Registration failed. ' + (err instanceof Error ? err.message : 'Try again.'));
@@ -293,7 +290,7 @@ export default function SponsorSignupPage() {
Sponsorship Opportunities
</h2>
<p className="text-gray-400 max-w-2xl mx-auto">
Choose how you want to connect with the sim racing community.
Choose how you want to connect with the sim racing community.
Multiple sponsorship tiers and types to fit every budget and goal.
</p>
</div>
@@ -629,8 +626,8 @@ export default function SponsorSignupPage() {
onClick={() => toggleInterest(type.id)}
className={`
p-3 rounded-lg border text-left transition-all
${isSelected
? 'bg-primary-blue/10 border-primary-blue/50'
${isSelected
? 'bg-primary-blue/10 border-primary-blue/50'
: 'bg-iron-gray/50 border-charcoal-outline hover:border-charcoal-outline/80'
}
`}