From 8564688f8f9843b9db69f71a9f2bc1006ee2ffbe Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 22:09:26 +0000 Subject: [PATCH] Update src/app/teachers/page.tsx --- src/app/teachers/page.tsx | 524 +++++++++++++++++++++++++++++++++++--- 1 file changed, 489 insertions(+), 35 deletions(-) diff --git a/src/app/teachers/page.tsx b/src/app/teachers/page.tsx index b61987b..9fbbac6 100644 --- a/src/app/teachers/page.tsx +++ b/src/app/teachers/page.tsx @@ -1,38 +1,167 @@ "use client"; +import { useState } from "react"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; -import SplitAbout from "@/components/sections/about/SplitAbout"; +import Input from "@/components/form/Input"; import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; -import { Users, BookOpen, Clock, Award } from "lucide-react"; +import { ChevronRight, Check } from "lucide-react"; -export default function TeachersPage() { +export default function TeacherRegistrationPage() { const navItems = [ { name: "Ana Sayfa", id: "/" }, { name: "Öğretmenler", id: "/teachers" }, - { name: "Etkinlikler", id: "events" }, + { name: "Öğrenciler", id: "/students" }, { name: "Çalışma Programı", id: "schedule" }, ]; - const bulletPoints = [ - { - title: "Deneyimli Profesyoneller", description: "50+ sertifikalı ve deneyimli öğretmen", icon: Users, - }, - { - title: "Kapsamlı Ders Katalogları", description: "200+ farklı konu ve disiplin", icon: BookOpen, - }, - { - title: "Esnek Zaman Planlaması", description: "Kendi zaman diliminizde dersler", icon: Clock, - }, - { - title: "Kalite Garantisi", description: "4.9/5 ortalama memnuniyet oranı", icon: Award, - }, - ]; + const [currentStep, setCurrentStep] = useState(1); + const totalSteps = 5; - const contactButtons = [ - { - text: "Öğretmen Bul", href: "#"}, - ]; + // Personal Info Step + const [personalInfo, setPersonalInfo] = useState({ + firstName: "", lastName: "", email: "", phone: ""}); + const [personalErrors, setPersonalErrors] = useState>({}); + + // Education Step + const [education, setEducation] = useState({ + degree: "", university: "", field: "", year: ""}); + const [educationErrors, setEducationErrors] = useState>({}); + + // Lesson Details Step + const [lessonDetails, setLessonDetails] = useState({ + subjects: "", levels: "", experience: "", bio: ""}); + const [lessonErrors, setLessonErrors] = useState>({}); + + // Pricing Step + const [pricing, setPricing] = useState({ + hourlyRate: "", currency: "USD", availability: ""}); + const [pricingErrors, setPricingErrors] = useState>({}); + + // Identity Verification Step + const [identity, setIdentity] = useState({ + idType: "", idNumber: "", dob: ""}); + const [identityErrors, setIdentityErrors] = useState>({}); + + const validateStep = (step: number): boolean => { + let isValid = true; + const errors: Record = {}; + + if (step === 1) { + if (!personalInfo.firstName.trim()) { + errors.firstName = "Ad gereklidir"; + isValid = false; + } + if (!personalInfo.lastName.trim()) { + errors.lastName = "Soyadı gereklidir"; + isValid = false; + } + if (!personalInfo.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) { + errors.email = "Geçerli bir email adı girin"; + isValid = false; + } + if (!personalInfo.phone.match(/^[0-9\s+()-]{10}$/)) { + errors.phone = "Geçerli bir telefon numarası girin"; + isValid = false; + } + setPersonalErrors(errors); + } + + if (step === 2) { + if (!education.degree.trim()) { + errors.degree = "Derece türü gereklidir"; + isValid = false; + } + if (!education.university.trim()) { + errors.university = "Üniversite adı gereklidir"; + isValid = false; + } + if (!education.field.trim()) { + errors.field = "Alan gereklidir"; + isValid = false; + } + if (!education.year.trim()) { + errors.year = "Mezuniyet yılı gereklidir"; + isValid = false; + } + setEducationErrors(errors); + } + + if (step === 3) { + if (!lessonDetails.subjects.trim()) { + errors.subjects = "Konular gereklidir"; + isValid = false; + } + if (!lessonDetails.levels.trim()) { + errors.levels = "Seviyeler gereklidir"; + isValid = false; + } + if (!lessonDetails.experience.trim()) { + errors.experience = "Deneyim gereklidir"; + isValid = false; + } + if (!lessonDetails.bio.trim()) { + errors.bio = "Biyografi gereklidir"; + isValid = false; + } + setLessonErrors(errors); + } + + if (step === 4) { + if (!pricing.hourlyRate.match(/^[0-9]+(\.[0-9]{1,2})?$/)) { + errors.hourlyRate = "Geçerli bir fiyat girin"; + isValid = false; + } + if (!pricing.availability.trim()) { + errors.availability = "Kullanılabilirlik gereklidir"; + isValid = false; + } + setPricingErrors(errors); + } + + if (step === 5) { + if (!identity.idType.trim()) { + errors.idType = "Kimlik türü gereklidir"; + isValid = false; + } + if (!identity.idNumber.trim()) { + errors.idNumber = "Kimlik numarası gereklidir"; + isValid = false; + } + if (!identity.dob.trim()) { + errors.dob = "Doğum tarihi gereklidir"; + isValid = false; + } + setIdentityErrors(errors); + } + + return isValid; + }; + + const handleNext = () => { + if (validateStep(currentStep)) { + setCurrentStep(currentStep + 1); + } + }; + + const handlePrevious = () => { + setCurrentStep(currentStep - 1); + }; + + const handleSubmit = () => { + if (validateStep(currentStep)) { + console.log("Form submitted:", { + personalInfo, + education, + lessonDetails, + pricing, + identity, + }); + alert("Kayıt başarıyla tamamlandı!"); + } + }; + + const progressPercentage = (currentStep / totalSteps) * 100; return ( -
- +
+
+ {/* Header */} +
+

Öğretmen Kaydı

+

Adım {currentStep} / {totalSteps}

+
+ + {/* Progress Bar */} +
+
+ {Array.from({ length: totalSteps }).map((_, i) => ( +
+
+
+
+
+ ))} +
+
+
+
+
+ + {/* Form Container */} +
+ {/* Step 1: Personal Info */} + {currentStep === 1 && ( +
+

Kişisel Bilgiler

+
+
+ + setPersonalInfo({ ...personalInfo, firstName: value })} + type="text" + placeholder="Adınız" + required + /> + {personalErrors.firstName && ( +

{personalErrors.firstName}

+ )} +
+
+ + setPersonalInfo({ ...personalInfo, lastName: value })} + type="text" + placeholder="Soyadınız" + required + /> + {personalErrors.lastName && ( +

{personalErrors.lastName}

+ )} +
+
+
+ + setPersonalInfo({ ...personalInfo, email: value })} + type="email" + placeholder="example@email.com" + required + /> + {personalErrors.email && ( +

{personalErrors.email}

+ )} +
+
+ + setPersonalInfo({ ...personalInfo, phone: value })} + type="tel" + placeholder="+90 5XX XXX XXXX" + required + /> + {personalErrors.phone && ( +

{personalErrors.phone}

+ )} +
+
+ )} + + {/* Step 2: Education */} + {currentStep === 2 && ( +
+

Eğitim Bilgileri

+
+ + setEducation({ ...education, degree: value })} + type="text" + placeholder="örn. Lisans, Yüksek Lisans" + required + /> + {educationErrors.degree && ( +

{educationErrors.degree}

+ )} +
+
+ + setEducation({ ...education, university: value })} + type="text" + placeholder="Üniversite adı" + required + /> + {educationErrors.university && ( +

{educationErrors.university}

+ )} +
+
+ + setEducation({ ...education, field: value })} + type="text" + placeholder="Çalışma alanı" + required + /> + {educationErrors.field && ( +

{educationErrors.field}

+ )} +
+
+ + setEducation({ ...education, year: value })} + type="text" + placeholder="2020" + required + /> + {educationErrors.year && ( +

{educationErrors.year}

+ )} +
+
+ )} + + {/* Step 3: Lesson Details */} + {currentStep === 3 && ( +
+

Ders Detayları

+
+ + setLessonDetails({ ...lessonDetails, subjects: value })} + type="text" + placeholder="örn. Matematik, Fizik, İngilizce" + required + /> + {lessonErrors.subjects && ( +

{lessonErrors.subjects}

+ )} +
+
+ + setLessonDetails({ ...lessonDetails, levels: value })} + type="text" + placeholder="örn. İlkokul, Ortaokul, Lise" + required + /> + {lessonErrors.levels && ( +

{lessonErrors.levels}

+ )} +
+
+ + setLessonDetails({ ...lessonDetails, experience: value })} + type="text" + placeholder="örn. 5 yıl" + required + /> + {lessonErrors.experience && ( +

{lessonErrors.experience}

+ )} +
+
+ +