Update AboutUsPage, server routes, packages, and assets

This commit is contained in:
Vishva
2026-07-29 16:53:09 +05:30
parent ff9795e4c9
commit 3ee3d8c652
67 changed files with 7641 additions and 175 deletions
+23 -9
View File
@@ -31,8 +31,7 @@ export default function ContactSection({ isMobile, onOpenStrategy }) {
setErrorMsg('');
try {
// Try sending via API endpoint
const response = await fetch('/api/send', {
let response = await fetch('/api/contact', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -40,21 +39,36 @@ export default function ContactSection({ isMobile, onOpenStrategy }) {
name: formData.name,
email: formData.email,
phone: formData.phone,
interests: formData.subject,
subject: formData.subject,
message: formData.message
})
});
if (response.ok) {
if (!response.ok) {
response = await fetch('/api/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
type: 'contact',
name: formData.name,
email: formData.email,
phone: formData.phone,
subject: formData.subject,
message: formData.message
})
});
}
const resData = await response.json().catch(() => ({}));
if (response.ok && resData.success) {
setSubmitted(true);
setFormData({ name: '', email: '', phone: '', subject: '', message: '' });
} else {
// Fallback smooth demo success if backend API is not configured with live EmailJS keys
setSubmitted(true);
setFormData({ name: '', email: '', phone: '', subject: '', message: '' });
setErrorMsg(resData.error || resData.smtpError || 'Failed to send message. Please check SMTP configuration.');
}
} catch {
// Graceful fallback for local development without server
} catch (err) {
console.error('Contact submit error:', err);
setSubmitted(true);
setFormData({ name: '', email: '', phone: '', subject: '', message: '' });
} finally {