Compare commits

..

2 Commits

Author SHA1 Message Date
gpt-engineer-app[bot]
6acc1c97c7 Fix: Add header to contact page 2025-10-28 18:05:23 +00:00
gpt-engineer-app[bot]
1cc137da96 Fix: Make thread_id nullable 2025-10-28 18:01:00 +00:00
4 changed files with 30 additions and 8 deletions

View File

@@ -244,11 +244,11 @@ export function ContactForm() {
{/* Message */} {/* Message */}
<div className="space-y-2"> <div className="space-y-2">
<Label htmlFor="message">Message *</Label> <Label htmlFor="message">Message * (minimum 20 characters)</Label>
<Textarea <Textarea
id="message" id="message"
{...register('message')} {...register('message')}
placeholder="Please provide details about your inquiry..." placeholder="Please provide details about your inquiry (minimum 20 characters)..."
rows={6} rows={6}
disabled={isSubmitting} disabled={isSubmitting}
className={errors.message ? 'border-destructive' : ''} className={errors.message ? 'border-destructive' : ''}
@@ -257,8 +257,15 @@ export function ContactForm() {
{errors.message && ( {errors.message && (
<p className="text-sm text-destructive">{errors.message.message}</p> <p className="text-sm text-destructive">{errors.message.message}</p>
)} )}
<p className="text-sm text-muted-foreground ml-auto"> <p className={`text-sm ml-auto ${
(watch('message')?.length || 0) < 20
? 'text-destructive font-medium'
: 'text-muted-foreground'
}`}>
{watch('message')?.length || 0} / 2000 {watch('message')?.length || 0} / 2000
{(watch('message')?.length || 0) < 20 &&
` (${20 - (watch('message')?.length || 0)} more needed)`
}
</p> </p>
</div> </div>
</div> </div>
@@ -284,8 +291,15 @@ export function ContactForm() {
<Button <Button
type="submit" type="submit"
size="lg" size="lg"
disabled={isSubmitting || !captchaToken} disabled={isSubmitting || !captchaToken || (watch('message')?.length || 0) < 20}
className="w-full" className="w-full"
title={
!captchaToken
? 'Please complete the CAPTCHA'
: (watch('message')?.length || 0) < 20
? `Message must be at least 20 characters (currently ${watch('message')?.length || 0})`
: ''
}
> >
{isSubmitting ? ( {isSubmitting ? (
<> <>

View File

@@ -538,7 +538,7 @@ export type Database = {
response_count: number | null response_count: number | null
status: string status: string
subject: string subject: string
thread_id: string thread_id: string | null
updated_at: string updated_at: string
user_agent: string | null user_agent: string | null
user_id: string | null user_id: string | null
@@ -559,7 +559,7 @@ export type Database = {
response_count?: number | null response_count?: number | null
status?: string status?: string
subject: string subject: string
thread_id: string thread_id?: string | null
updated_at?: string updated_at?: string
user_agent?: string | null user_agent?: string | null
user_id?: string | null user_id?: string | null
@@ -580,7 +580,7 @@ export type Database = {
response_count?: number | null response_count?: number | null
status?: string status?: string
subject?: string subject?: string
thread_id?: string thread_id?: string | null
updated_at?: string updated_at?: string
user_agent?: string | null user_agent?: string | null
user_id?: string | null user_id?: string | null

View File

@@ -4,10 +4,13 @@ import { ContactInfoCard } from '@/components/contact/ContactInfoCard';
import { ContactFAQ } from '@/components/contact/ContactFAQ'; import { ContactFAQ } from '@/components/contact/ContactFAQ';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { Header } from '@/components/layout/Header';
export default function Contact() { export default function Contact() {
return ( return (
<div className="container mx-auto px-4 py-8 max-w-7xl"> <div className="min-h-screen bg-background">
<Header />
<div className="container mx-auto px-4 py-8 max-w-7xl">
{/* Hero Section */} {/* Hero Section */}
<div className="text-center mb-12"> <div className="text-center mb-12">
<h1 className="text-4xl md:text-5xl font-bold mb-4">Get in Touch</h1> <h1 className="text-4xl md:text-5xl font-bold mb-4">Get in Touch</h1>
@@ -110,5 +113,6 @@ export default function Contact() {
<ContactFAQ /> <ContactFAQ />
</div> </div>
</div> </div>
</div>
); );
} }

View File

@@ -0,0 +1,4 @@
-- Make thread_id nullable in contact_submissions table
-- Contact submissions don't have a thread until an admin replies
ALTER TABLE public.contact_submissions
ALTER COLUMN thread_id DROP NOT NULL;