Skip to content

Commit 137848c

Browse files
gbzarelliroot
andauthored
✨ Add Developer Mentorship Service & Fix Contact Form (#6)
* fix: add force-static export to sitemap for static build compatibility - Add 'export const dynamic = "force-static"' to sitemap.ts - Fixes Next.js static export build error when using output: export - Resolves make build-serve failing due to missing static export configuration * fix: correct repository URL and directory name in README.md - Update clone URL from generic 'seu-usuario/helpdev.git' to actual 'gbzarelli/helpdev.com.br.git' - Fix directory name in clone instructions from 'helpdev' to 'helpdev.com.br' - Update project structure section to reflect correct directory name * feat: add services page, contact form, and major site improvements 🚀 New Features: - Add /services page with detailed service offerings and pricing - Create ContactForm component with FormSubmit integration for lead generation - Add /thanks page for form submission confirmation - Implement robots.txt for SEO optimization - Add comprehensive Makefile for development workflow automation - Add AGENTS.md documentation for AI-assisted development 🏗️ Site Architecture Improvements: - Upgrade to Next.js 15 with App Router and React 19 - Update to Tailwind CSS 4 with modern styling - Enhanced homepage with hero section, services preview, and clear CTAs - Improved navigation with services link and responsive design - Updated footer with enhanced styling and contact information - Better metadata configuration for SEO optimization 📱 UI/UX Enhancements: - Responsive design improvements across all pages - Modern card layouts and improved typography - Enhanced color scheme with better contrast and accessibility - Interactive elements with hover effects and smooth transitions - Mobile-first design approach with optimized touch targets ⚙️ Developer Experience: - Updated package.json with latest dependencies - Next.js configuration optimized for static export - Automated build and serve commands via Makefile - Better development workflow with make commands - Improved project structure and organization 🔧 Technical Updates: - Static export compatibility for hosting on static servers - Optimized build process with proper caching strategies - Enhanced metadata and SEO configuration - Better error handling and user feedback systems * feat: add specialized developer mentorship service and rename team training - Add 'Mentoria Especializada para Desenvolvedor' as new service with FaUserGraduate icon - Rename 'Mentoria & Treinamentos' to 'Treinamentos Corporativos' for better differentiation - Update both homepage and services page for consistency - Individual mentorship focuses on 1:1 technical guidance and career development - Corporate training focuses on team workshops and company-wide capacity building * fix: improve ContactForm configuration and validation for FormSubmit - Convert ContactForm to Client Component with 'use client' - Use absolute URLs for redirect (required by FormSubmit) - Add acceptCharset='UTF-8' for proper character encoding - Add _template='table' for better email formatting - Improve honeypot field with proper styling and attributes - Add client-side form validation with user feedback - Add onSubmit handler to validate before sending to FormSubmit This should resolve the 'Form should POST' error by ensuring proper FormSubmit configuration. --------- Co-authored-by: root <root@gbzarelli-nitro5>
1 parent 853404b commit 137848c

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

src/app/components/ContactForm/index.tsx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,56 @@
1+
'use client';
2+
13
import React from 'react';
24

35
type Props = {
46
redirectPath?: string;
57
subject?: string;
68
};
79

10+
// Form validation function
11+
function validateForm(form: HTMLFormElement): boolean {
12+
const requiredFields = form.querySelectorAll('input[required], textarea[required]');
13+
for (const field of requiredFields) {
14+
const input = field as HTMLInputElement | HTMLTextAreaElement;
15+
if (!input.value.trim()) {
16+
alert(`Por favor, preencha o campo: ${input.previousElementSibling?.textContent || 'obrigatório'}`);
17+
input.focus();
18+
return false;
19+
}
20+
}
21+
return true;
22+
}
23+
824
export function ContactForm({
925
redirectPath = '/thanks',
1026
subject = 'Novo contato - Proposta | HelpDev',
1127
}: Props) {
1228
const actionUrl = 'https://formsubmit.co/gbzarelli@helpdev.com.br';
29+
const fullRedirectUrl = `https://helpdev.com.br${redirectPath}`;
30+
31+
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
32+
const form = e.currentTarget;
33+
if (!validateForm(form)) {
34+
e.preventDefault();
35+
return;
36+
}
37+
// Form is valid, let it submit normally to FormSubmit
38+
};
1339

1440
return (
1541
<form
1642
action={actionUrl}
1743
method="POST"
44+
acceptCharset="UTF-8"
45+
onSubmit={handleSubmit}
1846
className="bg-white text-gray-900 p-6 rounded-xl shadow-md max-w-2xl mx-auto text-left"
1947
>
2048
{/* FormSubmit configuration */}
21-
<input type="hidden" name="_next" value={redirectPath} />
49+
<input type="hidden" name="_next" value={fullRedirectUrl} />
2250
<input type="hidden" name="_subject" value={subject} />
2351
<input type="hidden" name="_captcha" value="false" />
24-
<input type="text" name="_honey" className="hidden" aria-hidden="true" />
52+
<input type="hidden" name="_template" value="table" />
53+
<input type="text" name="_honey" style={{display: 'none'}} tabIndex={-1} autoComplete="off" />
2554

2655
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
2756
<div>

0 commit comments

Comments
 (0)