Skip to content

Commit c149186

Browse files
committed
fix: center form with proper margins and prevent scrolling
- Change form from fullscreen to centered card layout - Add proper margins on both sides with max-width constraint - Center form using flexbox with items-center and justify-center - Add form card with rounded corners, border, and shadow - Set max-height to 90vh to prevent overflow and scrolling - Improve header styling with larger title and close button - Create clean, professional modal presentation - Maintain backdrop blur and click-to-close functionality
1 parent 3f17f28 commit c149186

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/components/ui/ContactForm.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ ${formData.discussion}
159159
initial={{ opacity: 0, scale: 0.95 }}
160160
animate={{ opacity: 1, scale: 1 }}
161161
exit={{ opacity: 0, scale: 0.95 }}
162-
className="fixed inset-0 z-50 bg-background flex flex-col"
162+
className="fixed inset-0 z-50 flex items-center justify-center p-4"
163163
style={{
164164
position: 'fixed',
165165
top: 0,
@@ -170,19 +170,21 @@ ${formData.discussion}
170170
}}
171171
onClick={(e) => e.stopPropagation()}
172172
>
173-
{/* Header */}
174-
<div className="flex items-center justify-between p-4 border-b border-border flex-shrink-0">
175-
<h1 className="text-xl font-bold text-foreground">Coffee Chat Request</h1>
176-
<button
177-
onClick={onClose}
178-
className="p-2 rounded-lg hover:bg-muted/50 transition-colors"
179-
>
180-
<X className="w-5 h-5 text-muted-foreground" />
181-
</button>
182-
</div>
173+
{/* Form Card */}
174+
<div className="bg-background border border-border rounded-2xl shadow-2xl w-full max-w-4xl max-h-[90vh] flex flex-col">
175+
{/* Header */}
176+
<div className="flex items-center justify-between p-6 border-b border-border flex-shrink-0">
177+
<h1 className="text-2xl font-bold text-foreground">Coffee Chat Request</h1>
178+
<button
179+
onClick={onClose}
180+
className="p-2 rounded-lg hover:bg-muted/50 transition-colors"
181+
>
182+
<X className="w-6 h-6 text-muted-foreground" />
183+
</button>
184+
</div>
183185

184-
{/* Form */}
185-
<div className="flex-1 overflow-y-auto p-6">
186+
{/* Form */}
187+
<div className="flex-1 overflow-y-auto p-6">
186188
<form onSubmit={handleSubmit} className="space-y-8">
187189
{/* Section 1: About You */}
188190
<div className="space-y-4">
@@ -379,6 +381,7 @@ ${formData.discussion}
379381
</motion.button>
380382
</div>
381383
</form>
384+
</div>
382385
</div>
383386
</motion.div>
384387
</AnimatePresence>

0 commit comments

Comments
 (0)