chore: Remove swiss-german-teacher waitlist and update nav

- Remove WaitlistForm component and useWaitlistForm hook
- Remove waitlist types from types/index.ts
- Update buttons to link to demo section instead of removed waitlist
- Update nav menu items to match actual page sections

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
g-butandClaude Opus 4.5 committed 2026-01-23 11:46:27 +01:00
1 parent 4929569807
commit b09e776a89
7 files changed
+10 -230

No files matched your search

@@ -52,11 +52,11 @@ const SwissContentSection: React.FC = () => {
<div className="text-center">
<button
onClick={() => document.getElementById('waitlist-form')?.scrollIntoView({ behavior: 'smooth' })}
onClick={() => document.getElementById('demo')?.scrollIntoView({ behavior: 'smooth' })}
className={btnSecondary}
aria-label="Join waitlist for Swiss content"
aria-label="Try Heidi now"
>
Join Waitlist for Early Access
Try Heidi Now
</button>
</div>
</div>
@@ -1,94 +0,0 @@
import React from 'react';
import { useWaitlistForm } from '../../hooks/useWaitlistForm';
import { btnPrimary } from '../../utils/constants';
import { WaitlistPreferences } from '../../types';
const WaitlistForm = () => {
const { formState, updateEmail, togglePreference, handleSubmit } = useWaitlistForm();
const { email, preferences, isSubmitting, isSubmitted, error } = formState;
// Map of preference keys to display text
const preferenceLabels: Record<keyof WaitlistPreferences, string> = {
learningTools: "Advanced learning tools and pronunciation features",
communityFeatures: "Community features and language exchange",
authenticContent: "Authentic Swiss German content and media",
culturalInsights: "Cultural insights and local events",
earlyAccess: "Early access to new features",
emailUpdates: "Email updates about product development"
};
if (isSubmitted) {
return (
<div className="bg-green-50 rounded-lg p-6 border border-green-200 text-center">
<svg className="h-12 w-12 text-green-500 mx-auto mb-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
</svg>
<h3 className="text-xl font-medium text-gray-900 mb-2">Thank You!</h3>
<p className="text-gray-600">
You've been added to our waitlist. We'll notify you when we have updates about the features you're interested in.
</p>
</div>
);
}
return (
<form id="waitlist-form" onSubmit={handleSubmit} className="bg-white rounded-lg p-6 border border-gray-200 shadow-sm">
<h3 className="text-xl font-medium text-gray-900 mb-4">Join the Waitlist</h3>
<div className="mb-6">
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">
Email Address
</label>
<input
type="email"
id="email"
value={email}
onChange={(e) => updateEmail(e.target.value)}
className="w-full p-3 border rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
placeholder="your@email.com"
required
aria-describedby={error ? "email-error" : undefined}
/>
{error && <p id="email-error" className="mt-1 text-sm text-red-600">{error}</p>}
</div>
<div className="mb-6">
<p className="block text-sm font-medium text-gray-700 mb-2">
I'm interested in: (select all that apply)
</p>
<div className="space-y-2">
{Object.entries(preferenceLabels).map(([key, label]) => (
<div key={key} className="flex items-start">
<div className="flex items-center h-5">
<input
id={`preference-${key}`}
type="checkbox"
checked={preferences[key as keyof WaitlistPreferences]}
onChange={() => togglePreference(key as keyof WaitlistPreferences)}
className="focus:ring-green-500 h-4 w-4 text-green-600 border-gray-300 rounded"
/>
</div>
<div className="ml-3 text-sm">
<label htmlFor={`preference-${key}`} className="text-gray-700">
{label}
</label>
</div>
</div>
))}
</div>
</div>
<div className="text-center">
<button
type="submit"
disabled={isSubmitting}
className={`${btnPrimary} w-full sm:w-auto ${isSubmitting ? 'opacity-75 cursor-not-allowed' : ''}`}
aria-label="Join waitlist"
>
{isSubmitting ? 'Submitting...' : 'Join Waitlist'}
</button>
</div>
</form>
);
};
export default WaitlistForm;
@@ -156,11 +156,11 @@ const SocialSection = ({ getTryLink }: SocialSectionProps) => {
<div className="mt-6 text-center md:col-span-2">
<button
onClick={() => document.getElementById('waitlist-form')?.scrollIntoView({ behavior: 'smooth' })}
onClick={() => document.getElementById('demo')?.scrollIntoView({ behavior: 'smooth' })}
className={btnSecondary}
aria-label="Get notified when cultural insights are available"
aria-label="Try Heidi to learn about Swiss culture"
>
Get Notified When Available
Ask Heidi About Swiss Culture
</button>
</div>
</div>
@@ -1,92 +0,0 @@
import { useState, useCallback } from 'react';
import { WaitlistFormState, WaitlistPreferences } from '../types';
import { isValidEmail } from '../utils/validation';
const initialPreferences: WaitlistPreferences = {
learningTools: true,
communityFeatures: false,
authenticContent: true,
culturalInsights: false,
earlyAccess: true,
emailUpdates: true
};
/**
* Hook to manage waitlist form state and submission
*/
export const useWaitlistForm = () => {
const [formState, setFormState] = useState<WaitlistFormState>({
email: '',
preferences: initialPreferences,
isSubmitting: false,
isSubmitted: false,
error: null
});
const updateEmail = useCallback((email: string) => {
setFormState(prev => ({
...prev,
email,
error: null
}));
}, []);
const togglePreference = useCallback((key: keyof WaitlistPreferences) => {
setFormState(prev => ({
...prev,
preferences: {
...prev.preferences,
[key]: !prev.preferences[key]
}
}));
}, []);
const handleSubmit = useCallback(async (e: React.FormEvent) => {
e.preventDefault();
// Validate email
if (!isValidEmail(formState.email)) {
setFormState(prev => ({
...prev,
error: 'Please enter a valid email address'
}));
return;
}
// Start submission
setFormState(prev => ({
...prev,
isSubmitting: true,
error: null
}));
try {
// Simulate API call with a timeout
await new Promise(resolve => setTimeout(resolve, 1500));
// Success state
setFormState(prev => ({
...prev,
isSubmitting: false,
isSubmitted: true
}));
} catch (error) {
// Error handling
setFormState(prev => ({
...prev,
isSubmitting: false,
error: error instanceof Error ? error.message : 'Failed to submit'
}));
}
}, [formState.email]);
return {
formState,
updateEmail,
togglePreference,
handleSubmit
};
};
export default useWaitlistForm;
+1 -17
View File
@@ -8,7 +8,6 @@ import CommunicationSection from './components/communication/CommunicationSectio
import SocialSection from './components/social/SocialSection';
import SwissContentSection from './components/content/SwissContentSection';
import FutureVisionSection from './components/future/FutureVisionSection';
import WaitlistForm from './components/shared/WaitlistForm';
export default function SwissGermanTeacher() {
const heroConfig = getBotHeroConfig('swiss-german-teacher');
@@ -62,24 +61,9 @@ export default function SwissGermanTeacher() {
<SwissContentSection />
</BotSection>
<BotSection id="future">
<BotSection id="future" isLast>
<FutureVisionSection />
</BotSection>
<BotSection id="waitlist" isLast>
<div className="bg-gradient-to-r from-green-50 to-blue-50 rounded-xl shadow-sm overflow-hidden">
<div className="px-6 py-12 max-w-3xl mx-auto">
<h2 className="text-3xl font-semibold text-gray-900 text-center mb-2">
Join Our Beta Program
</h2>
<p className="text-lg text-gray-600 text-center mb-8">
Be one of the first to experience our upcoming features and help shape the
future of Swiss German learning.
</p>
<WaitlistForm />
</div>
</div>
</BotSection>
</>
);
}}
@@ -26,24 +26,6 @@ export interface ConversationExample {
translation: string;
}
// Waitlist form types
export interface WaitlistPreferences {
learningTools: boolean;
communityFeatures: boolean;
authenticContent: boolean;
culturalInsights: boolean;
earlyAccess: boolean;
emailUpdates: boolean;
}
export interface WaitlistFormState {
email: string;
preferences: WaitlistPreferences;
isSubmitting: boolean;
isSubmitted: boolean;
error: string | null;
}
// Demo mode types
export interface DemoState {
isActive: boolean;
+3 -3
View File
@@ -41,10 +41,10 @@ const bots: Bot[] = [
accentColor: 'red',
menuItems: [
{ id: 'demo', label: 'Demo', icon: '💬', section: 'demo' },
{ id: 'features', label: 'Features', icon: '✨', section: 'features' },
{ id: 'language-learning', label: 'Learning', icon: '📚', section: 'language-learning' },
{ id: 'communication', label: 'Communication', icon: '✉️', section: 'communication' },
{ id: 'culture', label: 'Culture', icon: '🏔️', section: 'culture' },
{ id: 'waitlist', label: 'Join Waitlist', icon: '📝', section: 'waitlist' }
{ id: 'integration', label: 'Social', icon: '🏔️', section: 'integration' },
{ id: 'future', label: 'Vision', icon: '🚀', section: 'future' }
]
}
},