From 26d38a057eb41bb1f5ce2491a81edbaed76e844d Mon Sep 17 00:00:00 2001 From: rockyeverlast Date: Mon, 29 Apr 2024 19:18:26 +0530 Subject: [PATCH] Added country code to form/ updated Subnets --- package.json | 1 + src/components/Contact/Form.jsx | 86 +++++++++++++------ .../SubnetsComponent/NewSubnetComp.jsx | 2 +- src/index.css | 10 +++ 4 files changed, 70 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 0a18478..36a2b04 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "react-google-recaptcha": "^3.1.0", "react-hook-form": "^7.51.2", "react-intersection-observer": "^9.8.1", + "react-phone-input-2": "^2.15.1", "react-redux": "^9.1.1", "react-router-dom": "^6.22.3", "swiper": "^11.1.0" diff --git a/src/components/Contact/Form.jsx b/src/components/Contact/Form.jsx index 87b7da7..4a5a1eb 100644 --- a/src/components/Contact/Form.jsx +++ b/src/components/Contact/Form.jsx @@ -29,6 +29,8 @@ import forml from "../../assets/images/forml.png"; import { Link } from "react-router-dom"; import ReCAPTCHA from "react-google-recaptcha"; import { contactUs } from "../../service/api"; +import PhoneInput from "react-phone-input-2"; +import "react-phone-input-2/lib/style.css"; const Contact = () => { const { @@ -45,6 +47,11 @@ const Contact = () => { // const email = "rubix@gmail.com"; + const preprocessPhoneNumber = (value) => { + // Remove any non-digit characters from the phone number + return value.replace(/\D/g, ""); + }; + const handleVerify = (token) => { setRecaptchaToken(token); }; @@ -58,6 +65,7 @@ const Contact = () => { // reset(); // } + console.log(data.phone); try { const result = await contactUs(data); if (result.status) { @@ -432,7 +440,7 @@ const Contact = () => { value: /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, message: "Please enter a valid email address", }, - required: true, + required: "Email ID is required", })} /> {errors.email && ( @@ -453,34 +461,55 @@ const Contact = () => { > Phone* - ( + + )} /> + {/* */} {errors.phone && (

{errors.phone.message} @@ -528,6 +557,7 @@ const Contact = () => { + )} /> diff --git a/src/components/SubnetsComponent/NewSubnetComp.jsx b/src/components/SubnetsComponent/NewSubnetComp.jsx index 91ca45c..1df02be 100644 --- a/src/components/SubnetsComponent/NewSubnetComp.jsx +++ b/src/components/SubnetsComponent/NewSubnetComp.jsx @@ -462,7 +462,7 @@ export const NewSubnetComp = () => { > 51.4 Million RBT - Fixed Supply.Hardcapped + Fixed Supply. Hardcapped diff --git a/src/index.css b/src/index.css index b0b2ac0..d66d1a4 100644 --- a/src/index.css +++ b/src/index.css @@ -167,6 +167,16 @@ span.swiper-pagination-bullet { font-weight: 900 !important; } +.react-tel-input .form-control { + margin-top: 10px !important; + margin-bottom: 5px !important; +} + +.react-tel-input .flag-dropdown { + background-color: #de858e; + border: none; +} + @media only screen and (max-width: 600px) { .swiper-button-prev:after, .swiper-button-next:after {