From 87fcf77b3fa0c1955efbaae7bafe43cbe927a65b Mon Sep 17 00:00:00 2001 From: iqbal024 Date: Fri, 18 Apr 2025 02:17:21 +0700 Subject: [PATCH] remove checkbox in page scheduler --- components/custom/Schedule.js | 356 +++++++++++++++++----------------- 1 file changed, 178 insertions(+), 178 deletions(-) diff --git a/components/custom/Schedule.js b/components/custom/Schedule.js index 8150ac0..5798381 100644 --- a/components/custom/Schedule.js +++ b/components/custom/Schedule.js @@ -4,181 +4,181 @@ import "react-phone-number-input/style.css"; import PhoneInput from "react-phone-number-input"; export default function Schedule({ onFormSubmit }) { - const [formData, setFormData] = useState({ - firstName: "", - lastName: "", - emailAddress: "", - phoneNumber: "", - companyName: "", - websiteUrl: "", - annualRevenue: "", - learnFrom: "", - additionalInfo: "", - checkbox: false, - }); + const [formData, setFormData] = useState({ + firstName: "", + lastName: "", + emailAddress: "", + phoneNumber: "", + companyName: "", + websiteUrl: "", + annualRevenue: "", + learnFrom: "", + additionalInfo: "", + checkbox: false, + }); - const handleChange = (e) => { - const { name, value, type, checked } = e.target; - setFormData((prevState) => ({ - ...prevState, - [name]: type === "checkbox" ? checked : value, - })); - }; + const handleChange = (e) => { + const { name, value, type, checked } = e.target; + setFormData((prevState) => ({ + ...prevState, + [name]: type === "checkbox" ? checked : value, + })); + }; - const handlePhoneChange = (value) => { - setFormData((prevState) => ({ - ...prevState, - phoneNumber: value, - })); - }; + const handlePhoneChange = (value) => { + setFormData((prevState) => ({ + ...prevState, + phoneNumber: value, + })); + }; - const handleSubmit = async (e) => { - e.preventDefault(); - try { - const response = await fetch("/api/schedule-send", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(formData), - }); + const handleSubmit = async (e) => { + e.preventDefault(); + try { + const response = await fetch("/api/schedule-send", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(formData), + }); - if (response.ok) { - document.cookie = `prospectClient=true; path=/; max-age=31536000`; - onFormSubmit(); - } else { - throw new Error("Form submission failed"); - } - } catch (error) { - console.error("Error:", error); - alert("An error occurred while submitting the form."); - } - }; + if (response.ok) { + document.cookie = `prospectClient=true; path=/; max-age=31536000`; + onFormSubmit(); + } else { + throw new Error("Form submission failed"); + } + } catch (error) { + console.error("Error:", error); + alert("An error occurred while submitting the form."); + } + }; - return ( -
-
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
-
Estimated Annual Revenue*
- -
-
-
How Did You Learn About RankRunners?*
- -
-
-