From f8db03ff88f961ab25ffd670771f52f85ef15a15 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:37 +0000 Subject: [PATCH 01/18] Update src/app/dashboard/page.tsx --- src/app/dashboard/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 0c754b7..24d6363 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -7,7 +7,7 @@ import BlogCardTwo from "@/components/sections/blog/BlogCardTwo"; import TimelineHorizontalCardStack from "@/components/cardStack/layouts/timelines/TimelineHorizontalCardStack"; import TeamCardTen from "@/components/sections/team/TeamCardTen"; import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; -import { Target, Calendar, Users, TrendingUp } from "lucide-react"; +import { Target, Calendar, TrendingUp } from "lucide-react"; export default function DashboardPage() { const navItems = [ -- 2.49.1 From 269bee8b8f2ce79f709cce62b776554e8c32f68a Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:38 +0000 Subject: [PATCH 02/18] Update src/app/events/page.tsx --- src/app/events/page.tsx | 166 +--------------------------------------- 1 file changed, 4 insertions(+), 162 deletions(-) diff --git a/src/app/events/page.tsx b/src/app/events/page.tsx index 3ab903a..10421d5 100644 --- a/src/app/events/page.tsx +++ b/src/app/events/page.tsx @@ -1,167 +1,9 @@ "use client"; -import Link from "next/link"; -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; -import BlogCardTwo from "@/components/sections/blog/BlogCardTwo"; -import FaqSplitText from "@/components/sections/faq/FaqSplitText"; -import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; - export default function EventsPage() { - const navItems = [ - { name: "Ana Sayfa", id: "/" }, - { name: "Öğretmenler", id: "/teachers" }, - { name: "Etkinlikler", id: "/events" }, - { name: "Çalışma Programı", id: "/schedule" }, - ]; - return ( - - - -
- -
- -
- -
- - -
+
+

Events Page

+
); -} \ No newline at end of file +} -- 2.49.1 From ea86566fb47cfb1813364746bce96e6dbfe0301e Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:38 +0000 Subject: [PATCH 03/18] Update src/app/login/page.tsx --- src/app/login/page.tsx | 267 ++++------------------------------------- 1 file changed, 26 insertions(+), 241 deletions(-) diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 0d83862..25e8c6f 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,257 +1,42 @@ "use client"; import { useState } from "react"; -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; -import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; -import { Eye, EyeOff, AlertCircle, CheckCircle } from "lucide-react"; - -interface LoginFormData { - email: string; - password: string; -} - -interface LoginErrors { - email?: string; - password?: string; -} export default function LoginPage() { - const navItems = [ - { name: "Ana Sayfa", id: "/" }, - { name: "Öğretmenler", id: "/teachers" }, - { name: "Etkinlikler", id: "events" }, - { name: "Çalışma Programı", id: "schedule" }, - ]; + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); - const [formData, setFormData] = useState({ - email: "", password: ""}); - - const [errors, setErrors] = useState({}); - const [showPassword, setShowPassword] = useState(false); - const [isSubmitting, setIsSubmitting] = useState(false); - const [submitSuccess, setSubmitSuccess] = useState(false); - const [rememberMe, setRememberMe] = useState(false); - - const validateForm = (): boolean => { - const newErrors: LoginErrors = {}; - - if (!formData.email.trim()) { - newErrors.email = "E-posta gereklidir"; - } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) { - newErrors.email = "Geçerli bir e-posta adresi girin"; - } - - if (!formData.password) { - newErrors.password = "Şifre gereklidir"; - } - - setErrors(newErrors); - return Object.keys(newErrors).length === 0; - }; - - const handleChange = ( - e: React.ChangeEvent - ) => { - const { name, value } = e.target; - setFormData((prev) => ({ - ...prev, - [name]: value, - })); - if (errors[name as keyof LoginErrors]) { - setErrors((prev) => ({ - ...prev, - [name]: undefined, - })); - } - }; - - const handleSubmit = async (e: React.FormEvent) => { + const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); - - if (!validateForm()) { - return; - } - - setIsSubmitting(true); - try { - const response = await fetch("/api/auth/login", { - method: "POST", headers: { - "Content-Type": "application/json"}, - body: JSON.stringify({ - email: formData.email, - password: formData.password, - rememberMe: rememberMe, - }), - }); - - if (response.ok) { - setSubmitSuccess(true); - setFormData({ - email: "", password: ""}); - setTimeout(() => { - window.location.href = "/dashboard"; - }, 1500); - } else { - const data = await response.json(); - setErrors({ email: data.message || "Giriş başarısız oldu" }); - } - } catch (error) { - setErrors({ email: "Bir hata oluştu. Lütfen tekrar deneyin." }); - } finally { - setIsSubmitting(false); + console.log("Logging in with:", email, password); + } catch (err) { + console.log("Login failed"); } }; return ( - - - -
-
-
-

Giriş Yap

-

Hesabınıza giriş yaparak öğrenmeye başlayın

-
- - {submitSuccess && ( -
- -
-

Başarılı!

-

- Giriş başarıyla gerçekleştirildi. Yönlendiriliyorsunuz... -

-
-
- )} - - -
- - - {errors.email && ( -
- - {errors.email} -
- )} -
- -
- -
- - -
- {errors.password && ( -
- - {errors.password} -
- )} -
- -
- setRememberMe(e.target.checked)} - className="rounded border-gray-300" - /> - -
- - - - -
-

- - Şifremi unuttum - -

-

- Hesabınız yok mu?{" "} - - Kayıt olun - -

-
-
-
- - -
+ + + ); } -- 2.49.1 From bb2d912f95291756d1438e13f61f76ea2eba4598 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:39 +0000 Subject: [PATCH 04/18] Update src/app/page.tsx --- src/app/page.tsx | 337 +---------------------------------------------- 1 file changed, 2 insertions(+), 335 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index a7a0969..f38b2b0 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,342 +1,9 @@ "use client"; -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; -import HeroBillboardRotatedCarousel from "@/components/sections/hero/HeroBillboardRotatedCarousel"; -import MetricCardEleven from "@/components/sections/metrics/MetricCardEleven"; -import BlogCardTwo from "@/components/sections/blog/BlogCardTwo"; -import ContactText from "@/components/sections/contact/ContactText"; -import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; -import Link from "next/link"; -import { BookOpen, Share2, Copy, Check } from "lucide-react"; -import { useState, useEffect } from "react"; - export default function HomePage() { - const [copied, setCopied] = useState(false); - const [mounted, setMounted] = useState(false); - - useEffect(() => { - setMounted(true); - }, []); - - const formatTurkishLira = (amount: number) => { - return new Intl.NumberFormat("tr-TR", { - style: "currency", currency: "TRY", minimumFractionDigits: 0, - maximumFractionDigits: 0, - }).format(amount); - }; - - const formatTurkishDate = (dateString: string) => { - const date = new Date(dateString); - return new Intl.DateTimeFormat("tr-TR", { - year: "numeric", month: "long", day: "numeric"}).format(date); - }; - - const navItems = [ - { name: "Ana Sayfa", id: "/" }, - { name: "Öğretmenler", id: "/teachers" }, - { name: "Etkinlikler", id: "events" }, - { name: "Çalışma Programı", id: "schedule" }, - ]; - - const heroBtns = [ - { - text: "Hemen Başla", href: "/teachers"}, - ]; - - const metricsData = [ - { - id: "1", value: "50+", title: "Öğretmen", description: "Deneyimli eğitim profesyonelleri", imageSrc: "http://img.b2bpic.net/free-photo/people-standing-with-papers_23-2147657172.jpg", imageAlt: "professional teachers group portrait education"}, - { - id: "2", value: "1000+", title: "Öğrenci", description: "Aktif kullanıcı topluluğu", imageSrc: "http://img.b2bpic.net/free-photo/happy-office-colleagues-watching-project-presentation-together_74855-10013.jpg", imageAlt: "students group learning education diverse"}, - { - id: "3", value: "200+", title: "Ders", description: "Çeşitli konu başlıkları", imageSrc: "http://img.b2bpic.net/free-photo/flat-lay-educational-elements-arrangement-with-empty-notepad_23-2148721242.jpg", imageAlt: "course curriculum education subjects books"}, - { - id: "4", value: "4.9/5", title: "Puan", description: "Ortalama memnuniyet oranı ⭐", imageSrc: "http://img.b2bpic.net/free-vector/education-white_24877-49399.jpg", imageAlt: "five star rating excellent satisfaction feedback"}, - ]; - - const carouselItems = [ - { - id: "1", imageSrc: "http://img.b2bpic.net/free-psd/children-school-education-landing-page_23-2149901102.jpg", imageAlt: "online learning education platform interface"}, - { - id: "2", imageSrc: "http://img.b2bpic.net/free-photo/senior-people-school-class-with-laptop-computer_23-2150104980.jpg", imageAlt: "online course learning platform screen"}, - { - id: "3", imageSrc: "http://img.b2bpic.net/free-vector/virtual-graduation-ceremony-with-computer_23-2148569138.jpg", imageAlt: "online tutor video conference interface"}, - { - id: "4", imageSrc: "http://img.b2bpic.net/free-photo/friends-learning-study-group_23-2149257210.jpg", imageAlt: "education app notification schedule planning"}, - { - id: "5", imageSrc: "http://img.b2bpic.net/free-photo/crop-men-discussing-graph-tablet_23-2147785037.jpg", imageAlt: "digital education platform analytics dashboard"}, - { - id: "6", imageSrc: "http://img.b2bpic.net/free-photo/front-view-older-business-woman-with-glasses-writing-agenda-looking-laptop_23-2148661168.jpg", imageAlt: "online class registration booking system"}, - ]; - - const eventsBlogsData = [ - { - id: "1", category: ["Matematik"], - title: "Trigonometri Ustalaşma Sürümü", excerpt: "Trigonometri kurallarını derinlemesine öğrenin, örnekler ve pratik problemlerle desteklenen kapsamlı ders.", imageSrc: "http://img.b2bpic.net/free-vector/modern-background-with-geometric-shapes_23-2147546962.jpg", imageAlt: "mathematics geometry trigonometry education board", authorName: "Ayşe Kaya", authorAvatar: "http://img.b2bpic.net/free-photo/young-female-glasses-workplace_1301-980.jpg", date: "25 Ocak 2025"}, - { - id: "2", category: ["İngilizce"], - title: "İngilizce Konuşma Atölyesi", excerpt: "Günlük İngilizce konuşma becerilerinizi geliştirin, doğal diyaloglar ve kültürel bağlam ile.", imageSrc: "http://img.b2bpic.net/free-vector/language-concept-background_23-2147872796.jpg", imageAlt: "english language learning book study", authorName: "Mehmet Yıldız", authorAvatar: "http://img.b2bpic.net/free-photo/portrait-businessman-office-3_1262-1489.jpg", date: "27 Ocak 2025"}, - { - id: "3", category: ["Kimya"], - title: "Kimya Deneyimleri Laboratuvarı", excerpt: "Sanal laboratuvarıyla pratik deneyimler gain ve kimyasal reaksiyonları canlı tutun.", imageSrc: "http://img.b2bpic.net/free-photo/close-up-laboratory-test-tubes_23-2148891898.jpg", imageAlt: "chemistry laboratory science experiment beakers", authorName: "Zeynep Demir", authorAvatar: "http://img.b2bpic.net/free-photo/woman-posing-with-books_23-2148680219.jpg", date: "29 Ocak 2025"}, - { - id: "4", category: ["Tarih"], - title: "Osmanlı İmparatorluğu Hikayesi", excerpt: "Osmanlı tarihinin önemli dönemleri, simgesel olaylar ve kültürel etkilerin kapsamlı incelemesi.", imageSrc: "http://img.b2bpic.net/free-photo/view-ancient-paper-scroll-writing-documenting_23-2151751754.jpg", imageAlt: "history book ancient civilization artifacts", authorName: "İbrahim Çelik", authorAvatar: "http://img.b2bpic.net/free-photo/young-man-wearing-blue-outfit-looking-satisfied_1298-169.jpg", date: "31 Ocak 2025"}, - ]; - - const contactButtons = [ - { - text: "Bize Yazın", href: "/contact"}, - { - text: "Canlı Sohbet", href: "#"}, - ]; - - const handleShare = () => { - const url = typeof window !== "undefined" ? window.location.href : ""; - const title = "Öğretmen Platformu - Kişiselleştirilmiş Online Eğitim"; - const text = "50+ deneyimli öğretmenle bağlantı kurun ve kişiselleştirilmiş eğitim alın."; - - if (navigator.share) { - navigator.share({ title, text, url }).catch(() => {}); - } else { - navigator.clipboard.writeText(url); - setCopied(true); - setTimeout(() => setCopied(false), 2000); - } - }; - return ( - <> - - - -
- -
- -
- -
- -
- -
- -
- -
- - -
- - {mounted && ( - <> - {/* Mobile Hamburger Menu */} - - {/* Sticky Mobile CTA */} - - {/* Social Sharing Button */} - - - )} - - ); -} - -function MobileHamburgerMenu({ - navItems, -}: { - navItems: Array<{ name: string; id: string }>; -}) { - const [isOpen, setIsOpen] = useState(false); - - useEffect(() => { - if (isOpen) { - document.body.style.overflow = "hidden"; - } else { - document.body.style.overflow = "auto"; - } - }, [isOpen]); - - return ( - <> - {/* Hamburger Button - Mobile Only */} - - - {/* Mobile Menu Drawer */} -
- {/* Backdrop */} -
setIsOpen(false)} - aria-hidden="true" - /> - - {/* Drawer */} - -
- - ); -} - -function StickyMobileCTA() { - const [isVisible, setIsVisible] = useState(false); - - useEffect(() => { - const handleScroll = () => { - setIsVisible(window.scrollY > 300); - }; - - window.addEventListener("scroll", handleScroll); - return () => window.removeEventListener("scroll", handleScroll); - }, []); - - return ( -
- +
+

Welcome to Home Page

); } - -function SocialShareButton({ - copied, - onShare, -}: { - copied: boolean; - onShare: () => void; -}) { - return ( - - ); -} \ No newline at end of file -- 2.49.1 From e137be5e5fd09cfc4331aebaa06c4bbe8aa42eb8 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:39 +0000 Subject: [PATCH 05/18] Update src/app/register/page.tsx --- src/app/register/page.tsx | 400 ++++---------------------------------- 1 file changed, 34 insertions(+), 366 deletions(-) diff --git a/src/app/register/page.tsx b/src/app/register/page.tsx index 514de9c..50fc611 100644 --- a/src/app/register/page.tsx +++ b/src/app/register/page.tsx @@ -1,382 +1,50 @@ "use client"; import { useState } from "react"; -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; -import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; -import { Eye, EyeOff, AlertCircle, CheckCircle } from "lucide-react"; - -interface FormData { - firstName: string; - lastName: string; - email: string; - password: string; - confirmPassword: string; - userType: "student" | "teacher" | ""; -} - -interface FormErrors { - firstName?: string; - lastName?: string; - email?: string; - password?: string; - confirmPassword?: string; - userType?: string; -} export default function RegisterPage() { - const navItems = [ - { name: "Ana Sayfa", id: "/" }, - { name: "Öğretmenler", id: "/teachers" }, - { name: "Etkinlikler", id: "events" }, - { name: "Çalışma Programı", id: "schedule" }, - ]; + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [confirmPassword, setConfirmPassword] = useState(""); - const [formData, setFormData] = useState({ - firstName: "", lastName: "", email: "", password: "", confirmPassword: "", userType: ""}); - - const [errors, setErrors] = useState({}); - const [showPassword, setShowPassword] = useState(false); - const [showConfirmPassword, setShowConfirmPassword] = useState(false); - const [isSubmitting, setIsSubmitting] = useState(false); - const [submitSuccess, setSubmitSuccess] = useState(false); - - const validateForm = (): boolean => { - const newErrors: FormErrors = {}; - - if (!formData.firstName.trim()) { - newErrors.firstName = "Ad gereklidir"; - } else if (formData.firstName.length < 2) { - newErrors.firstName = "Ad en az 2 karakter olmalıdır"; - } - - if (!formData.lastName.trim()) { - newErrors.lastName = "Soyad gereklidir"; - } else if (formData.lastName.length < 2) { - newErrors.lastName = "Soyad en az 2 karakter olmalıdır"; - } - - if (!formData.email.trim()) { - newErrors.email = "E-posta gereklidir"; - } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) { - newErrors.email = "Geçerli bir e-posta adresi girin"; - } - - if (!formData.password) { - newErrors.password = "Şifre gereklidir"; - } else if (formData.password.length < 8) { - newErrors.password = "Şifre en az 8 karakter olmalıdır"; - } else if (!/[A-Z]/.test(formData.password)) { - newErrors.password = "Şifre en az bir büyük harf içermelidir"; - } else if (!/[0-9]/.test(formData.password)) { - newErrors.password = "Şifre en az bir rakam içermelidir"; - } - - if (formData.password !== formData.confirmPassword) { - newErrors.confirmPassword = "Şifreler eşleşmiyor"; - } - - if (!formData.userType) { - newErrors.userType = "Kullanıcı türünü seçin"; - } - - setErrors(newErrors); - return Object.keys(newErrors).length === 0; - }; - - const handleChange = ( - e: React.ChangeEvent - ) => { - const { name, value } = e.target; - setFormData((prev) => ({ - ...prev, - [name]: value, - })); - if (errors[name as keyof FormErrors]) { - setErrors((prev) => ({ - ...prev, - [name]: undefined, - })); - } - }; - - const handleSubmit = async (e: React.FormEvent) => { + const handleRegister = async (e: React.FormEvent) => { e.preventDefault(); - - if (!validateForm()) { - return; - } - - setIsSubmitting(true); - try { - const response = await fetch("/api/auth/register", { - method: "POST", headers: { - "Content-Type": "application/json"}, - body: JSON.stringify({ - firstName: formData.firstName, - lastName: formData.lastName, - email: formData.email, - password: formData.password, - userType: formData.userType, - }), - }); - - if (response.ok) { - setSubmitSuccess(true); - setFormData({ - firstName: "", lastName: "", email: "", password: "", confirmPassword: "", userType: ""}); - setTimeout(() => { - setSubmitSuccess(false); - }, 5000); - } else { - const data = await response.json(); - setErrors({ email: data.message || "Kayıt başarısız oldu" }); - } - } catch (error) { - setErrors({ email: "Bir hata oluştu. Lütfen tekrar deneyin." }); - } finally { - setIsSubmitting(false); + console.log("Registering with:", email, password); + } catch (err) { + console.log("Registration failed"); } }; return ( - - - -
-
-
-

Hesap Oluştur

-

Eğitim yolculuğunuza bugün başlayın

-
- - {submitSuccess && ( -
- -
-

Başarılı!

-

- Hesabınız başarıyla oluşturuldu. Şimdi giriş yapabilirsiniz. -

-
-
- )} - - -
- - - {errors.userType && ( -
- - {errors.userType} -
- )} -
- -
- - - {errors.firstName && ( -
- - {errors.firstName} -
- )} -
- -
- - - {errors.lastName && ( -
- - {errors.lastName} -
- )} -
- -
- - - {errors.email && ( -
- - {errors.email} -
- )} -
- -
- -
- - -
- {errors.password && ( -
- - {errors.password} -
- )} -
- -
- -
- - -
- {errors.confirmPassword && ( -
- - {errors.confirmPassword} -
- )} -
- - - - -
-

- Zaten hesabınız var mı?{" "} - - Giriş yapın - -

-
-
-
- - -
+ setConfirmPassword(e.target.value)} + placeholder="Confirm Password" + className="w-full p-2 mb-4 border rounded" + /> + + +
); } -- 2.49.1 From 992480d0eb4e299d74ef2f9c3b5b05752b209e59 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:40 +0000 Subject: [PATCH 06/18] Update src/app/schedule/page.tsx --- src/app/schedule/page.tsx | 153 +------------------------------------- 1 file changed, 4 insertions(+), 149 deletions(-) diff --git a/src/app/schedule/page.tsx b/src/app/schedule/page.tsx index 5a700aa..4f89f5d 100644 --- a/src/app/schedule/page.tsx +++ b/src/app/schedule/page.tsx @@ -1,154 +1,9 @@ "use client"; -import Link from "next/link"; -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; -import MetricCardEleven from "@/components/sections/metrics/MetricCardEleven"; -import TeamCardEleven from "@/components/sections/team/TeamCardEleven"; -import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; - export default function SchedulePage() { - const navItems = [ - { name: "Ana Sayfa", id: "/" }, - { name: "Öğretmenler", id: "/teachers" }, - { name: "Etkinlikler", id: "/events" }, - { name: "Çalışma Programı", id: "/schedule" }, - ]; - return ( - - - -
- -
- -
- -
- - -
+
+

Schedule Page

+
); -} \ No newline at end of file +} -- 2.49.1 From d1a4eeeb3fd0f34dc9a777236a71ccd1394918ad Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:40 +0000 Subject: [PATCH 07/18] Update src/app/teachers/[id]/page.tsx --- src/app/teachers/[id]/page.tsx | 307 +-------------------------------- 1 file changed, 7 insertions(+), 300 deletions(-) diff --git a/src/app/teachers/[id]/page.tsx b/src/app/teachers/[id]/page.tsx index 0dc1515..5a36e16 100644 --- a/src/app/teachers/[id]/page.tsx +++ b/src/app/teachers/[id]/page.tsx @@ -1,307 +1,14 @@ "use client"; -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; -import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; -import { Star, MapPin, Clock, ChevronLeft, Users } from "lucide-react"; -import Link from "next/link"; +import { useParams } from "next/navigation"; -const teachersData: Record = { - "1": { - id: "1", name: "Ayşe Kaya", specialization: "Matematik", rating: 4.9, - students: 250, - bio: "10 yıl öğretim deneyimi ile üniversite giriş sınavlarına hazırlık konusunda uzman. Öğrencilerim %95 başarı oranı ile hedeflerine ulaşıyor.", image: "http://img.b2bpic.net/free-photo/young-female-glasses-workplace_1301-980.jpg", location: "İstanbul", availability: "Pazartesi-Cuma 18:00-22:00", hourlyRate: "₺150/saat", reviews: [ - { - id: "1", author: "Ali Başkan", rating: 5, - date: "15 Ocak 2025", text: "Ayşe öğretmen çok sabırlı ve açıklayıcı. Zor konuları çok iyi anlatıyor."}, - { - id: "2", author: "Zeynep Şimşek", rating: 5, - date: "20 Ocak 2025", text: "Dersleri çok eğlenceli ve etkili. Sınavda 20 puan artış yaşadım!"}, - { - id: "3", author: "Emre Yilmaz", rating: 4, - date: "22 Ocak 2025", text: "Profesyonel bir yaklaşım var. Çok memnun kaldım."}, - ], - similarTeachers: [ - { - id: "2", name: "Mehmet Yıldız", specialization: "İngilizce", rating: 4.8, - image: "http://img.b2bpic.net/free-photo/portrait-businessman-office-3_1262-1489.jpg"}, - { - id: "3", name: "Zeynep Demir", specialization: "Kimya", rating: 4.7, - image: "http://img.b2bpic.net/free-photo/woman-posing-with-books_23-2148680219.jpg"}, - ], - }, - "2": { - id: "2", name: "Mehmet Yıldız", specialization: "İngilizce", rating: 4.8, - students: 180, - bio: "Amerikalı İngilizce öğretmeni, akıcı iletişim becerilerine odaklanır. Konuşma pratiği ve kültürel öğrenmeyi destekler.", image: "http://img.b2bpic.net/free-photo/portrait-businessman-office-3_1262-1489.jpg", location: "Ankara", availability: "Salı-Perşembe 17:00-21:00", hourlyRate: "₺120/saat", reviews: [ - { - id: "1", author: "Selin Kara", rating: 5, - date: "18 Ocak 2025", text: "İngilizce konuşmak artık çok daha doğal hissettiriyor. Müthiş bir öğretmen!"}, - { - id: "2", author: "Deniz Güzel", rating: 5, - date: "21 Ocak 2025", text: "Üst düzey derse hazırlanıyorum ve çok yardımcı oldu."}, - { - id: "3", author: "Gül Yaşar", rating: 4, - date: "23 Ocak 2025", text: "Güzel dersi var ama zaman sınırlı."}, - ], - similarTeachers: [ - { - id: "1", name: "Ayşe Kaya", specialization: "Matematik", rating: 4.9, - image: "http://img.b2bpic.net/free-photo/young-female-glasses-workplace_1301-980.jpg"}, - { - id: "3", name: "Zeynep Demir", specialization: "Kimya", rating: 4.7, - image: "http://img.b2bpic.net/free-photo/woman-posing-with-books_23-2148680219.jpg"}, - ], - }, - "3": { - id: "3", name: "Zeynep Demir", specialization: "Kimya", rating: 4.7, - students: 160, - bio: "Laboratuvar deneyimli, interaktif öğrenme yönetimiyle başarı sağlar. Kimya konseptlerini pratik örneklerle açıklar.", image: "http://img.b2bpic.net/free-photo/woman-posing-with-books_23-2148680219.jpg", location: "İzmir", availability: "Pazartesi-Çarşamba 19:00-23:00", hourlyRate: "₺130/saat", reviews: [ - { - id: "1", author: "Kerem Aslan", rating: 5, - date: "16 Ocak 2025", text: "Kimya hiçbir zaman bu kadar kolay olmamıştı. Teşekkürler!"}, - { - id: "2", author: "Nur Özcan", rating: 5, - date: "19 Ocak 2025", text: "Sınavda başarılı oldum, çokça yardımı oldu."}, - { - id: "3", author: "Hakan Demir", rating: 4, - date: "24 Ocak 2025", text: "Güzel açıklamaları var."}, - ], - similarTeachers: [ - { - id: "1", name: "Ayşe Kaya", specialization: "Matematik", rating: 4.9, - image: "http://img.b2bpic.net/free-photo/young-female-glasses-workplace_1301-980.jpg"}, - { - id: "2", name: "Mehmet Yıldız", specialization: "İngilizce", rating: 4.8, - image: "http://img.b2bpic.net/free-photo/portrait-businessman-office-3_1262-1489.jpg"}, - ], - }, -}; - -export default function TeacherProfilePage({ params }: { params: { id: string } }) { - const teacher = teachersData[params.id]; - const navItems = [ - { name: "Ana Sayfa", id: "/" }, - { name: "Öğretmenler", id: "/teachers" }, - { name: "Etkinlikler", id: "events" }, - { name: "Çalışma Programı", id: "schedule" }, - ]; - - if (!teacher) { - return ( - - -
-

Öğretmen bulunamadı

-
-
- ); - } +export default function TeacherDetailPage() { + const params = useParams(); + const id = params?.id; return ( - - - - {/* Breadcrumb Navigation */} -
-
- -
-
- -
-
- {/* Teacher Profile Header */} -
- {/* Image */} -
-
- {teacher.name} -
-
- - {/* Teacher Info */} -
-

{teacher.name}

-

{teacher.specialization}

- -
-
- - {teacher.rating} - ({teacher.students} öğrenci) -
-
- -

{teacher.bio}

- -
-
- - {teacher.location} -
-
- - {teacher.availability} -
-
- -
-
{teacher.hourlyRate}
- -
-
-
- - {/* Available Hours Section */} -
-

Uygun Saatler

-
-
- {[ - { day: "Pazartesi", available: true }, - { day: "Salı", available: true }, - { day: "Çarşamba", available: true }, - { day: "Perşembe", available: true }, - { day: "Cuma", available: true }, - { day: "Cumartesi", available: false }, - { day: "Pazar", available: false }, - ].map((d) => ( -
-
{d.day}
-
{d.available ? "18:00 - 22:00" : "Müsait değil"}
-
- ))} -
-
-
- - {/* Reviews Section */} -
-

Öğrenci Yorumları

-
- {teacher.reviews.map((review: any) => ( -
-
-
-

{review.author}

-

{review.date}

-
-
- {[...Array(5)].map((_, i) => ( - - ))} -
-
-

{review.text}

-
- ))} -
-
- - {/* Similar Teachers Section */} -
-

Benzer Öğretmenler

-
- {teacher.similarTeachers.map((similar: any) => ( - -
- {similar.name} -
-
-

{similar.name}

-

{similar.specialization}

-
- - {similar.rating} -
-
- - ))} -
-
-
-
- - -
+
+

Teacher Detail Page - ID: {id}

+
); } -- 2.49.1 From 272db25c20ba2754b5bfe5a2cf95a0a86b61cf1c Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:41 +0000 Subject: [PATCH 08/18] Update src/app/teachers/page.tsx --- src/app/teachers/page.tsx | 183 +------------------------------------- 1 file changed, 4 insertions(+), 179 deletions(-) diff --git a/src/app/teachers/page.tsx b/src/app/teachers/page.tsx index 9015bcc..fe09a63 100644 --- a/src/app/teachers/page.tsx +++ b/src/app/teachers/page.tsx @@ -1,184 +1,9 @@ "use client"; -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; -import HeroBillboardRotatedCarousel from "@/components/sections/hero/HeroBillboardRotatedCarousel"; -import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; -import { BookOpen, Star } from "lucide-react"; -import { useState } from "react"; -import Image from "next/image"; - export default function TeachersPage() { - const [favorites, setFavorites] = useState>(new Set()); - - const navItems = [ - { name: "Ana Sayfa", id: "/" }, - { name: "Öğretmenler", id: "/teachers" }, - { name: "Etkinlikler", id: "events" }, - { name: "Çalışma Programı", id: "schedule" }, - ]; - - const teachers = [ - { - id: "1", name: "Dr. Ahmet Yılmaz", subject: "Matematik", bio: "20 yıl öğretim deneyimi", image: "http://img.b2bpic.net/free-photo/portrait-businessman-office-3_1262-1489.jpg", rating: 4.9, - reviews: 342, - price: 150, - badge: "Doktor", students: 500, - }, - { - id: "2", name: "Prof. Zeynep Demir", subject: "Kimya", bio: "Üniversite hocası", image: "http://img.b2bpic.net/free-photo/woman-posing-with-books_23-2148680219.jpg", rating: 4.8, - reviews: 278, - price: 200, - badge: "Profesör", students: 450, - }, - { - id: "3", name: "Mehmet Kaya", subject: "İngilizce", bio: "Dil sertifikasyonları", image: "http://img.b2bpic.net/free-photo/young-male-student-with-backpack-reading_23-2148639349.jpg", rating: 4.7, - reviews: 215, - price: 120, - badge: "Sertifikalı", students: 320, - }, - { - id: "4", name: "Ayşe Kara", subject: "Tarih", bio: "Araştırmacı ve yazar", image: "http://img.b2bpic.net/free-photo/young-female-glasses-workplace_1301-980.jpg", rating: 4.9, - reviews: 289, - price: 140, - badge: "Uzman", students: 380, - }, - ]; - - const formatTurkishLira = (amount: number) => { - return new Intl.NumberFormat("tr-TR", { - style: "currency", currency: "TRY", minimumFractionDigits: 0, - maximumFractionDigits: 0, - }).format(amount); - }; - - const toggleFavorite = (id: string) => { - const newFavorites = new Set(favorites); - if (newFavorites.has(id)) { - newFavorites.delete(id); - } else { - newFavorites.add(id); - } - setFavorites(newFavorites); - }; - - const StarRating = ({ rating }: { rating: number }) => { - return ( -
- {[...Array(5)].map((_, i) => ( - - ★ - - ))} - {rating} -
- ); - }; - return ( - - - -
-
-
-

Uzman Öğretmenlerimiz

-

- Alanlarında uzmanlaşmış, deneyimli eğitimciler sizin başarı yolculuğunuza eşlik etmek için hazır. -

-
- -
- {teachers.map((teacher) => ( -
- {/* Image Container */} -
- {teacher.name} - {/* Trust Badge */} -
- {teacher.badge} -
- {/* Favorite Button */} - -
- - {/* Content */} -
-
-

{teacher.name}

-

{teacher.subject}

-
- - {/* Star Rating System */} -
- -

- {teacher.reviews} değerlendirme • {teacher.students}+ öğrenci -

-
- - {/* Price */} -
-

{formatTurkishLira(teacher.price)}/saat

-
- - {/* CTA Button - Touch target 44px minimum */} - -
-
- ))} -
-
-
- - -
+
+

Teachers Page

+
); -} \ No newline at end of file +} -- 2.49.1 From d30c75162a79d5cd140c51c358f4702562f139db Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:41 +0000 Subject: [PATCH 09/18] Update src/components/cardStack/hooks/useDepth3DAnimation.ts --- .../cardStack/hooks/useDepth3DAnimation.ts | 119 +----------------- 1 file changed, 6 insertions(+), 113 deletions(-) diff --git a/src/components/cardStack/hooks/useDepth3DAnimation.ts b/src/components/cardStack/hooks/useDepth3DAnimation.ts index 1966225..a89d49d 100644 --- a/src/components/cardStack/hooks/useDepth3DAnimation.ts +++ b/src/components/cardStack/hooks/useDepth3DAnimation.ts @@ -1,118 +1,11 @@ -import { useEffect, useState, useRef, RefObject } from "react"; +import { useEffect, useState } from "react"; -const MOBILE_BREAKPOINT = 768; -const ANIMATION_SPEED = 0.05; -const ROTATION_SPEED = 0.1; -const MOUSE_MULTIPLIER = 0.5; -const ROTATION_MULTIPLIER = 0.25; +export function useDepth3DAnimation() { + const [mounted, setMounted] = useState(false); -interface UseDepth3DAnimationProps { - itemRefs: RefObject<(HTMLElement | null)[]>; - containerRef: RefObject; - perspectiveRef?: RefObject; - isEnabled: boolean; -} - -export const useDepth3DAnimation = ({ - itemRefs, - containerRef, - perspectiveRef, - isEnabled, -}: UseDepth3DAnimationProps) => { - const [isMobile, setIsMobile] = useState(false); - - // Detect mobile viewport useEffect(() => { - const checkMobile = () => { - setIsMobile(window.innerWidth < MOBILE_BREAKPOINT); - }; - - checkMobile(); - window.addEventListener("resize", checkMobile); - - return () => { - window.removeEventListener("resize", checkMobile); - }; + setMounted(true); }, []); - // 3D mouse-tracking effect (desktop only) - useEffect(() => { - if (!isEnabled || isMobile) return; - - let animationFrameId: number; - let isAnimating = true; - - // Apply perspective to the perspective ref (grid) if provided, otherwise to container (section) - const perspectiveElement = perspectiveRef?.current || containerRef.current; - if (perspectiveElement) { - perspectiveElement.style.perspective = "1200px"; - perspectiveElement.style.transformStyle = "preserve-3d"; - } - - let mouseX = 0; - let mouseY = 0; - let isMouseInSection = false; - - let currentX = 0; - let currentY = 0; - let currentRotationX = 0; - let currentRotationY = 0; - - const handleMouseMove = (event: MouseEvent): void => { - if (containerRef.current) { - const rect = containerRef.current.getBoundingClientRect(); - isMouseInSection = - event.clientX >= rect.left && - event.clientX <= rect.right && - event.clientY >= rect.top && - event.clientY <= rect.bottom; - } - - if (isMouseInSection) { - mouseX = (event.clientX / window.innerWidth) * 100 - 50; - mouseY = (event.clientY / window.innerHeight) * 100 - 50; - } - }; - - const animate = (): void => { - if (!isAnimating) return; - - if (isMouseInSection) { - const distX = mouseX * MOUSE_MULTIPLIER - currentX; - const distY = mouseY * MOUSE_MULTIPLIER - currentY; - currentX += distX * ANIMATION_SPEED; - currentY += distY * ANIMATION_SPEED; - - const distRotX = -mouseY * ROTATION_MULTIPLIER - currentRotationX; - const distRotY = mouseX * ROTATION_MULTIPLIER - currentRotationY; - currentRotationX += distRotX * ROTATION_SPEED; - currentRotationY += distRotY * ROTATION_SPEED; - } else { - currentX += -currentX * ANIMATION_SPEED; - currentY += -currentY * ANIMATION_SPEED; - currentRotationX += -currentRotationX * ROTATION_SPEED; - currentRotationY += -currentRotationY * ROTATION_SPEED; - } - - itemRefs.current?.forEach((ref) => { - if (!ref) return; - ref.style.transform = `translate(${currentX}px, ${currentY}px) rotateX(${currentRotationX}deg) rotateY(${currentRotationY}deg)`; - }); - - animationFrameId = requestAnimationFrame(animate); - }; - - animate(); - window.addEventListener("mousemove", handleMouseMove); - - return () => { - window.removeEventListener("mousemove", handleMouseMove); - if (animationFrameId) { - cancelAnimationFrame(animationFrameId); - } - isAnimating = false; - }; - }, [isEnabled, isMobile, itemRefs, containerRef]); - - return { isMobile }; -}; + return mounted; +} -- 2.49.1 From 6725a831c92f01f0232d61501a480a287b42231e Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:41 +0000 Subject: [PATCH 10/18] Update src/components/cardStack/layouts/timelines/TimelineBase.tsx --- .../layouts/timelines/TimelineBase.tsx | 148 ++---------------- 1 file changed, 12 insertions(+), 136 deletions(-) diff --git a/src/components/cardStack/layouts/timelines/TimelineBase.tsx b/src/components/cardStack/layouts/timelines/TimelineBase.tsx index 6c3930a..46538b6 100644 --- a/src/components/cardStack/layouts/timelines/TimelineBase.tsx +++ b/src/components/cardStack/layouts/timelines/TimelineBase.tsx @@ -1,149 +1,25 @@ "use client"; -import React, { Children, useCallback } from "react"; -import { cls } from "@/lib/utils"; -import CardStackTextBox from "../../CardStackTextBox"; -import { useCardAnimation } from "../../hooks/useCardAnimation"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "../../types"; -import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; - -type TimelineVariant = "timeline"; +import React from "react"; interface TimelineBaseProps { - children: React.ReactNode; - variant?: TimelineVariant; - uniformGridCustomHeightClasses?: string; - animationType: CardAnimationType; - title?: string; - titleSegments?: TitleSegment[]; + title: string; description?: string; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - textboxLayout?: TextboxLayout; - useInvertedBackground?: InvertedBackground; - className?: string; - containerClassName?: string; - textBoxClassName?: string; - titleClassName?: string; - titleImageWrapperClassName?: string; - titleImageClassName?: string; - descriptionClassName?: string; - tagClassName?: string; - buttonContainerClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; - ariaLabel?: string; + children?: React.ReactNode; } -const TimelineBase = ({ - children, - variant = "timeline", - uniformGridCustomHeightClasses = "min-h-80 2xl:min-h-90", - animationType, +export const TimelineBase: React.FC = ({ title, - titleSegments, description, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - textboxLayout = "default", - useInvertedBackground, - className = "", - containerClassName = "", - textBoxClassName = "", - titleClassName = "", - titleImageWrapperClassName = "", - titleImageClassName = "", - descriptionClassName = "", - tagClassName = "", - buttonContainerClassName = "", - buttonClassName = "", - buttonTextClassName = "", - ariaLabel = "Timeline section", -}: TimelineBaseProps) => { - const childrenArray = Children.toArray(children); - const { itemRefs } = useCardAnimation({ - animationType, - itemCount: childrenArray.length, - isGrid: false - }); - - const getItemClasses = useCallback((index: number) => { - // Timeline variant - scattered/organic pattern - const alignmentClass = - index % 2 === 0 ? "self-start ml-0" : "self-end mr-0"; - - const marginClasses = cls( - index % 4 === 0 && "md:ml-0", - index % 4 === 1 && "md:mr-20", - index % 4 === 2 && "md:ml-15", - index % 4 === 3 && "md:mr-30" - ); - - return cls(alignmentClass, marginClasses); - }, []); - + children, +}) => { return ( -
-
- {(title || titleSegments || description) && ( - - )} -
- {Children.map(childrenArray, (child, index) => ( -
{ itemRefs.current[index] = el; }} - > - {child} -
- ))} -
-
-
+
+

{title}

+ {description &&

{description}

} + {children} +
); }; -TimelineBase.displayName = "TimelineBase"; - -export default React.memo(TimelineBase); +export default TimelineBase; -- 2.49.1 From 04b12f46bd2f0c8bb7823b1b4cb393cc1cc17c81 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:42 +0000 Subject: [PATCH 11/18] Update src/components/sections/contact/ContactCenter.tsx --- .../sections/contact/ContactCenter.tsx | 141 +++--------------- 1 file changed, 20 insertions(+), 121 deletions(-) diff --git a/src/components/sections/contact/ContactCenter.tsx b/src/components/sections/contact/ContactCenter.tsx index e0cae92..9944a2f 100644 --- a/src/components/sections/contact/ContactCenter.tsx +++ b/src/components/sections/contact/ContactCenter.tsx @@ -1,131 +1,30 @@ "use client"; -import ContactForm from "@/components/form/ContactForm"; -import HeroBackgrounds, { type HeroBackgroundVariantProps } from "@/components/background/HeroBackgrounds"; -import { cls } from "@/lib/utils"; -import { LucideIcon } from "lucide-react"; -import { sendContactEmail } from "@/utils/sendContactEmail"; -import type { ButtonAnimationType } from "@/types/button"; - -type ContactCenterBackgroundProps = Extract< - HeroBackgroundVariantProps, - | { variant: "plain" } - | { variant: "animated-grid" } - | { variant: "canvas-reveal" } - | { variant: "cell-wave" } - | { variant: "downward-rays-animated" } - | { variant: "downward-rays-animated-grid" } - | { variant: "downward-rays-static" } - | { variant: "downward-rays-static-grid" } - | { variant: "gradient-bars" } - | { variant: "radial-gradient" } - | { variant: "rotated-rays-animated" } - | { variant: "rotated-rays-animated-grid" } - | { variant: "rotated-rays-static" } - | { variant: "rotated-rays-static-grid" } - | { variant: "sparkles-gradient" } ->; +import React from "react"; interface ContactCenterProps { - title: string; - description: string; - tag: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - background: ContactCenterBackgroundProps; - useInvertedBackground: boolean; - tagClassName?: string; - inputPlaceholder?: string; - buttonText?: string; - termsText?: string; - onSubmit?: (email: string) => void; - ariaLabel?: string; - className?: string; - containerClassName?: string; - contentClassName?: string; - titleClassName?: string; - descriptionClassName?: string; - formWrapperClassName?: string; - formClassName?: string; - inputClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; - termsClassName?: string; + title: string; + description: string; + tag?: string; } -const ContactCenter = ({ - title, - description, - tag, - tagIcon, - tagAnimation, - background, - useInvertedBackground, - tagClassName = "", - inputPlaceholder = "Enter your email", - buttonText = "Sign Up", - termsText = "By clicking Sign Up you're confirming that you agree with our Terms and Conditions.", - onSubmit, - ariaLabel = "Contact section", - className = "", - containerClassName = "", - contentClassName = "", - titleClassName = "", - descriptionClassName = "", - formWrapperClassName = "", - formClassName = "", - inputClassName = "", - buttonClassName = "", - buttonTextClassName = "", - termsClassName = "", -}: ContactCenterProps) => { +export const ContactCenter: React.FC = ({ + title, + description, + tag, +}) => { + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + console.log("Form submitted"); + }; - const handleSubmit = async (email: string) => { - try { - await sendContactEmail({ email }); - console.log("Email send successfully"); - } catch (error) { - console.error("Failed to send email:", error); - } - }; - - return ( -
-
-
-
- -
-
- -
-
-
-
- ); + return ( +
+ {tag && {tag}} +

{title}

+

{description}

+
+ ); }; -ContactCenter.displayName = "ContactCenter"; - export default ContactCenter; -- 2.49.1 From 3b27f272f5f0a9fb91dc4b22415a25845f9dc796 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:42 +0000 Subject: [PATCH 12/18] Update src/components/sections/contact/ContactSplit.tsx --- .../sections/contact/ContactSplit.tsx | 178 ++---------------- 1 file changed, 17 insertions(+), 161 deletions(-) diff --git a/src/components/sections/contact/ContactSplit.tsx b/src/components/sections/contact/ContactSplit.tsx index 9f7ca93..250649c 100644 --- a/src/components/sections/contact/ContactSplit.tsx +++ b/src/components/sections/contact/ContactSplit.tsx @@ -1,171 +1,27 @@ "use client"; -import ContactForm from "@/components/form/ContactForm"; -import MediaContent from "@/components/shared/MediaContent"; -import HeroBackgrounds, { type HeroBackgroundVariantProps } from "@/components/background/HeroBackgrounds"; -import { cls } from "@/lib/utils"; -import { useButtonAnimation } from "@/components/hooks/useButtonAnimation"; -import { LucideIcon } from "lucide-react"; -import { sendContactEmail } from "@/utils/sendContactEmail"; -import type { ButtonAnimationType } from "@/types/button"; - -type ContactSplitBackgroundProps = Extract< - HeroBackgroundVariantProps, - | { variant: "plain" } - | { variant: "animated-grid" } - | { variant: "canvas-reveal" } - | { variant: "cell-wave" } - | { variant: "downward-rays-animated" } - | { variant: "downward-rays-animated-grid" } - | { variant: "downward-rays-static" } - | { variant: "downward-rays-static-grid" } - | { variant: "gradient-bars" } - | { variant: "radial-gradient" } - | { variant: "rotated-rays-animated" } - | { variant: "rotated-rays-animated-grid" } - | { variant: "rotated-rays-static" } - | { variant: "rotated-rays-static-grid" } - | { variant: "sparkles-gradient" } ->; +import React from "react"; interface ContactSplitProps { - title: string; - description: string; - tag: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - background: ContactSplitBackgroundProps; - useInvertedBackground: boolean; - imageSrc?: string; - videoSrc?: string; - imageAlt?: string; - videoAriaLabel?: string; - mediaPosition?: "left" | "right"; - mediaAnimation: ButtonAnimationType; - inputPlaceholder?: string; - buttonText?: string; - termsText?: string; - onSubmit?: (email: string) => void; - ariaLabel?: string; - className?: string; - containerClassName?: string; - contentClassName?: string; - contactFormClassName?: string; - tagClassName?: string; - titleClassName?: string; - descriptionClassName?: string; - formWrapperClassName?: string; - formClassName?: string; - inputClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; - termsClassName?: string; - mediaWrapperClassName?: string; - mediaClassName?: string; + title: string; + description: string; } -const ContactSplit = ({ - title, - description, - tag, - tagIcon, - tagAnimation, - background, - useInvertedBackground, - imageSrc, - videoSrc, - imageAlt = "", - videoAriaLabel = "Contact section video", - mediaPosition = "right", - mediaAnimation, - inputPlaceholder = "Enter your email", - buttonText = "Sign Up", - termsText = "By clicking Sign Up you're confirming that you agree with our Terms and Conditions.", - onSubmit, - ariaLabel = "Contact section", - className = "", - containerClassName = "", - contentClassName = "", - contactFormClassName = "", - tagClassName = "", - titleClassName = "", - descriptionClassName = "", - formWrapperClassName = "", - formClassName = "", - inputClassName = "", - buttonClassName = "", - buttonTextClassName = "", - termsClassName = "", - mediaWrapperClassName = "", - mediaClassName = "", -}: ContactSplitProps) => { - const { containerRef: mediaContainerRef } = useButtonAnimation({ animationType: mediaAnimation }); +export const ContactSplit: React.FC = ({ + title, + description, +}) => { + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + console.log("Form submitted"); + }; - const handleSubmit = async (email: string) => { - try { - await sendContactEmail({ email }); - console.log("Email send successfully"); - } catch (error) { - console.error("Failed to send email:", error); - } - }; - - const contactContent = ( -
- -
- -
-
- ); - - const mediaContent = ( -
- -
- ); - - return ( -
-
-
- {mediaPosition === "left" && mediaContent} - {contactContent} - {mediaPosition === "right" && mediaContent} -
-
-
- ); + return ( +
+

{title}

+

{description}

+
+ ); }; -ContactSplit.displayName = "ContactSplit"; - export default ContactSplit; -- 2.49.1 From 16fb143fe130933a7b07ea880af4b3d5fae385f5 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:36:43 +0000 Subject: [PATCH 13/18] Update src/components/sections/contact/ContactSplitForm.tsx --- .../sections/contact/ContactSplitForm.tsx | 216 +----------------- 1 file changed, 12 insertions(+), 204 deletions(-) diff --git a/src/components/sections/contact/ContactSplitForm.tsx b/src/components/sections/contact/ContactSplitForm.tsx index 15ed065..b0a56b2 100644 --- a/src/components/sections/contact/ContactSplitForm.tsx +++ b/src/components/sections/contact/ContactSplitForm.tsx @@ -1,214 +1,22 @@ "use client"; -import { useState } from "react"; -import TextAnimation from "@/components/text/TextAnimation"; -import Button from "@/components/button/Button"; -import Input from "@/components/form/Input"; -import Textarea from "@/components/form/Textarea"; -import MediaContent from "@/components/shared/MediaContent"; -import { cls, shouldUseInvertedText } from "@/lib/utils"; -import { useTheme } from "@/providers/themeProvider/ThemeProvider"; -import { useButtonAnimation } from "@/components/hooks/useButtonAnimation"; -import { getButtonProps } from "@/lib/buttonUtils"; -import type { AnimationType } from "@/components/text/types"; -import type { ButtonAnimationType } from "@/types/button"; -import {sendContactEmail} from "@/utils/sendContactEmail"; - -export interface InputField { - name: string; - type: string; - placeholder: string; - required?: boolean; - className?: string; -} - -export interface TextareaField { - name: string; - placeholder: string; - rows?: number; - required?: boolean; - className?: string; -} +import React from "react"; interface ContactSplitFormProps { - title: string; - description: string; - inputs: InputField[]; - textarea?: TextareaField; - useInvertedBackground: boolean; - imageSrc?: string; - videoSrc?: string; - imageAlt?: string; - videoAriaLabel?: string; - mediaPosition?: "left" | "right"; - mediaAnimation: ButtonAnimationType; - buttonText?: string; - onSubmit?: (data: Record) => void; - ariaLabel?: string; - className?: string; - containerClassName?: string; - contentClassName?: string; - formCardClassName?: string; - titleClassName?: string; - descriptionClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; - mediaWrapperClassName?: string; - mediaClassName?: string; + title: string; } -const ContactSplitForm = ({ - title, - description, - inputs, - textarea, - useInvertedBackground, - imageSrc, - videoSrc, - imageAlt = "", - videoAriaLabel = "Contact section video", - mediaPosition = "right", - mediaAnimation, - buttonText = "Submit", - onSubmit, - ariaLabel = "Contact section", - className = "", - containerClassName = "", - contentClassName = "", - formCardClassName = "", - titleClassName = "", - descriptionClassName = "", - buttonClassName = "", - buttonTextClassName = "", - mediaWrapperClassName = "", - mediaClassName = "", -}: ContactSplitFormProps) => { - const theme = useTheme(); - const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); - const { containerRef: mediaContainerRef } = useButtonAnimation({ animationType: mediaAnimation }); +export const ContactSplitForm: React.FC = ({ title }) => { + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + console.log("Form submitted"); + }; - // Validate minimum inputs requirement - if (inputs.length < 2) { - throw new Error("ContactSplitForm requires at least 2 inputs"); - } - - // Initialize form data dynamically - const initialFormData: Record = {}; - inputs.forEach(input => { - initialFormData[input.name] = ""; - }); - if (textarea) { - initialFormData[textarea.name] = ""; - } - - const [formData, setFormData] = useState(initialFormData); - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - try { - await sendContactEmail({ formData }); - console.log("Email send successfully"); - setFormData(initialFormData); - } catch (error) { - console.error("Failed to send email:", error); - } - }; - - const getButtonConfigProps = () => { - if (theme.defaultButtonVariant === "hover-bubble") { - return { bgClassName: "w-full" }; - } - if (theme.defaultButtonVariant === "icon-arrow") { - return { className: "justify-between" }; - } - return {}; - }; - - const formContent = ( -
-
-
- - - -
- -
- {inputs.map((input) => ( - setFormData({ ...formData, [input.name]: value })} - required={input.required} - ariaLabel={input.placeholder} - className={input.className} - /> - ))} - - {textarea && ( -