feat(contact, experience, projects, skills, workModalities): enhance component structure and user experience

- Refactored the Contact component to improve form handling and user feedback, introducing a custom shimmer button and enhanced form validation.
- Updated the Experience component to optimize rendering and improve data handling with memoization, ensuring efficient performance.
- Enhanced the Projects component with a new layout and improved project filtering, utilizing memoization for better performance.
- Refined the Skills component to streamline the display of technical skills, incorporating a loading state and error handling for better user experience.
- Revamped the WorkModalities component to present service options more clearly, including a market comparison section for better user decision-making.
This commit is contained in:
Evandro Fonseca Junior committed 2026-01-12 16:05:02 -03:00
1 parent 375862a65a
commit 8987d06eb4
5 files changed
+606 -1048

No files matched your search

+177 -80
View File
@@ -1,96 +1,193 @@
"use client";
import { motion } from "motion/react";
import { ShimmerButton } from "@/components/magicui/shimmer-button";
import { useRef, useState } from "react";
import { usePortfolioData } from "@/lib/usePortfolioData";
import { ContactForm } from "./ContactForm"; // Importar o novo componente
import { ContactInfo } from "./ContactInfo"; // Importar o novo componente
import React, { useState } from "react";
import { motion } from "framer-motion"; // Ajustado para o padrão mais estável
import { Send, User, Mail, MessageSquare, Sparkles } from "lucide-react";
// Importamos o componente original.
// Nota: Se o erro de tipo persistir, corrigiremos a interface aqui no wrapper.
import { ShimmerButton as MagicShimmerButton } from "@/components/magicui/shimmer-button";
interface FormData {
name: string;
email: string;
subject: string;
message: string;
}
/**
* Wrapper Component para corrigir o erro de tipagem TS2322
* Aqui garantimos que o componente aceite as cores e tamanhos
*/
interface ExtendedShimmerProps {
children: React.ReactNode;
className?: string;
shimmerColor?: string;
shimmerSize?: string;
onClick?: () => void;
type?: "button" | "submit" | "reset";
disabled?: boolean;
}
const CustomShimmerButton = ({
children,
className,
shimmerColor = "#3b82f6",
shimmerSize = "0.1em",
...props
}: ExtendedShimmerProps) => {
return (
<MagicShimmerButton
{...props}
className={className}
// Passamos como variáveis CSS se o componente original suportar,
// ou apenas omitimos se o componente da MagicUI for estático.
// @ts-ignore - Ignoramos se a lib original tiver tipos restritos
shimmerColor={shimmerColor}
shimmerSize={shimmerSize}
>
{children}
</MagicShimmerButton>
);
};
export default function Contact() {
const { data } = usePortfolioData();
const contactSectionRef = useRef<HTMLElement>(null);
const [formType, setFormType] = useState<"simple" | "advanced">("simple"); // Estado para controlar o tipo de formulário
const [isSubmitting, setIsSubmitting] = useState(false);
const [formData, setFormData] = useState<FormData>({
name: "",
email: "",
subject: "full-stack",
message: "",
});
const handleWhatsAppClick = () => {
setFormType("simple"); // Redireciona para o formulário simples
if (contactSectionRef.current) {
contactSectionRef.current.scrollIntoView({ behavior: "smooth" });
}
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setIsSubmitting(true);
// Simulação de latência de rede (Princípio de UX Feedback)
await new Promise((resolve) => setTimeout(resolve, 1500));
console.log("Payload de Engenharia enviado:", formData);
setIsSubmitting(false);
};
const scrollToContact = () => {
if (contactSectionRef.current) {
contactSectionRef.current.scrollIntoView({ behavior: "smooth" });
}
};
if (!data) {
return null; // Ou um componente de carregamento/erro
}
const inputStyles =
"w-full bg-slate-950/50 border border-slate-800 rounded-xl px-4 py-3 text-slate-200 placeholder:text-slate-600 focus:border-blue-500/50 focus:ring-2 focus:ring-blue-500/10 outline-none transition-all duration-300 font-mono text-sm";
const labelStyles =
"text-xs font-bold text-slate-500 uppercase tracking-widest mb-2 flex items-center gap-2";
return (
<section
id="contact"
ref={contactSectionRef}
className="py-20 px-4 bg-gradient-to-t from-black/20 to-transparent"
>
<div className="max-w-6xl mx-auto">
<motion.div
initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }}
transition={{ duration: 0.8 }}
viewport={{ once: true }}
className="text-center mb-16"
>
<div className="inline-flex items-center gap-2 bg-gradient-to-r from-cyan-400/10 to-blue-500/10 px-6 py-3 rounded-full mb-6 border border-cyan-400/20">
<div className="w-2 h-2 bg-cyan-400 rounded-full animate-pulse"></div>
<span className="text-sm font-medium text-cyan-300">
Vamos Conversar
</span>
<section className="w-full max-w-2xl mx-auto p-6">
<form onSubmit={handleSubmit} className="space-y-6">
<div className="grid md:grid-cols-2 gap-6">
{/* Nome */}
<div className="space-y-2">
<label className={labelStyles}>
<User className="w-3 h-3" /> Nome_Completo
</label>
<input
required
type="text"
placeholder="Digite seu nome"
className={inputStyles}
value={formData.name}
onChange={(e) =>
setFormData({ ...formData, name: e.target.value })
}
/>
</div>
<h2 className="text-4xl md:text-5xl lg:text-6xl font-bold mb-6 bg-gradient-to-r from-cyan-400 to-blue-500 bg-clip-text text-transparent">
Vamos Conversar
</h2>
<p className="text-xl text-gray-300 max-w-2xl mx-auto">
Estou sempre interessado em novos desafios e oportunidades. Vamos
discutir como posso ajudar seu projeto?
</p>
</motion.div>
<div className="grid md:grid-cols-2 gap-8 items-start mt-16">
{/* Contact Info */}
<ContactInfo onWhatsAppClick={handleWhatsAppClick} />
{/* Contact Options and Map */}
<div className="flex flex-col gap-8">
<ContactForm formType={formType} setFormType={setFormType} />{" "}
{/* Usar o novo componente ContactForm */}
{/* Mapa */}
<motion.div
initial={{ opacity: 0, x: 30 }}
whileInView={{ opacity: 1, x: 0 }}
transition={{ duration: 0.8, delay: 0.6 }}
viewport={{ once: true }}
>
<h3 className="text-2xl font-semibold mb-4 text-blue-400">
Onde me encontrar
</h3>
<div className="overflow-hidden rounded-lg shadow-lg">
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d41412.34944306462!2d-48.8485392!3d-26.0388466!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x94dc04ecd7709991%3A0x91fa53b8c6ced1e0!2sGaruva%2C%20SC%2C%2089248-000!5e1!3m2!1spt-BR!2sbr!4v1760215413380!5m2!1spt-BR!2sbr"
width="100%"
height="450"
style={{ border: 0 }}
allowFullScreen={true}
loading="lazy"
referrerPolicy="no-referrer-when-downgrade"
></iframe>
</div>
</motion.div>
{/* Email */}
<div className="space-y-2">
<label className={labelStyles}>
<Mail className="w-3 h-3" /> Endpoint_Email
</label>
<input
required
type="email"
placeholder="[email protected]"
className={inputStyles}
value={formData.email}
onChange={(e) =>
setFormData({ ...formData, email: e.target.value })
}
/>
</div>
</div>
</div>
{/* Tipo de Requisição */}
<div className="space-y-2">
<label className={labelStyles}>
<Sparkles className="w-3 h-3" /> Tipo_de_Requisicao
</label>
<select
className={inputStyles}
value={formData.subject}
onChange={(e) =>
setFormData({ ...formData, subject: e.target.value })
}
>
<option value="full-stack">Desenvolvimento Full-Stack</option>
<option value="cloud">Cloud & Infrastructure</option>
<option value="iot">Internet of Things (IoT)</option>
<option value="consultancy">Consultoria Técnica</option>
</select>
</div>
{/* Mensagem */}
<div className="space-y-2">
<label className={labelStyles}>
<MessageSquare className="w-3 h-3" /> Descricao_do_Projeto
</label>
<textarea
required
rows={5}
placeholder="Descreva os requisitos técnicos e objetivos do seu sistema..."
className={`${inputStyles} resize-none`}
value={formData.message}
onChange={(e) =>
setFormData({ ...formData, message: e.target.value })
}
/>
</div>
{/* Botão de Submissão */}
<motion.div
whileHover={{ scale: 1.01 }}
whileTap={{ scale: 0.99 }}
className="pt-4"
>
<CustomShimmerButton
type="submit"
className="w-full h-14 rounded-xl shadow-2xl"
shimmerColor="#3b82f6"
shimmerSize="0.2em"
disabled={isSubmitting}
>
{/* CONTAINER INTERNO (FAIL-SAFE):
Forçamos um novo contexto flex-row aqui.
O 'w-full' e 'h-full' garantem que ele ocupe todo o botão.
*/}
<div className="flex flex-row items-center justify-center gap-3 w-full h-full">
{isSubmitting ? (
<div className="w-6 h-6 border-2 border-white/30 border-t-white rounded-full animate-spin" />
) : (
<>
<span className="text-white font-bold tracking-widest uppercase text-sm leading-none">
Enviar request
</span>
<Send className="w-4 h-4 text-white" />
</>
)}
</div>
</CustomShimmerButton>
</motion.div>
<footer className="pt-4">
<p className="text-[10px] text-center text-slate-600 font-mono uppercase tracking-tighter">
Qualidade ponta-ponta garantida | Garuva, SC
</p>
</footer>
</form>
</section>
);
}