From 137848c43e7028fd9e08b9bb622b22e7e5f20915 Mon Sep 17 00:00:00 2001 From: Guilherme Biff Zarelli Date: Tue, 9 Sep 2025 18:09:10 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20Developer=20Mentorship=20Serv?= =?UTF-8?q?ice=20&=20Fix=20Contact=20Form=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- src/app/components/ContactForm/index.tsx | 33 ++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/app/components/ContactForm/index.tsx b/src/app/components/ContactForm/index.tsx index db92f99..02c2b9b 100644 --- a/src/app/components/ContactForm/index.tsx +++ b/src/app/components/ContactForm/index.tsx @@ -1,3 +1,5 @@ +'use client'; + import React from 'react'; type Props = { @@ -5,23 +7,50 @@ type Props = { subject?: string; }; +// Form validation function +function validateForm(form: HTMLFormElement): boolean { + const requiredFields = form.querySelectorAll('input[required], textarea[required]'); + for (const field of requiredFields) { + const input = field as HTMLInputElement | HTMLTextAreaElement; + if (!input.value.trim()) { + alert(`Por favor, preencha o campo: ${input.previousElementSibling?.textContent || 'obrigatório'}`); + input.focus(); + return false; + } + } + return true; +} + export function ContactForm({ redirectPath = '/thanks', subject = 'Novo contato - Proposta | HelpDev', }: Props) { const actionUrl = 'https://formsubmit.co/gbzarelli@helpdev.com.br'; + const fullRedirectUrl = `https://helpdev.com.br${redirectPath}`; + + const handleSubmit = (e: React.FormEvent) => { + const form = e.currentTarget; + if (!validateForm(form)) { + e.preventDefault(); + return; + } + // Form is valid, let it submit normally to FormSubmit + }; return (
{/* FormSubmit configuration */} - + - + +