updated image and Form server
2
.gitignore
vendored
@@ -12,6 +12,8 @@ dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
.env
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
|
||||
91
package-lock.json
generated
@@ -14,6 +14,7 @@
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@fontsource/poppins": "^5.0.12",
|
||||
"@gsap/react": "^2.1.0",
|
||||
"axios": "^1.6.8",
|
||||
"framer-motion": "^11.0.15",
|
||||
"react": "^18.2.0",
|
||||
"react-countup": "^6.5.2",
|
||||
@@ -2704,6 +2705,11 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
},
|
||||
"node_modules/available-typed-arrays": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
|
||||
@@ -2719,6 +2725,16 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
|
||||
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-macros": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz",
|
||||
@@ -2831,6 +2847,17 @@
|
||||
"resolved": "https://registry.npmjs.org/color2k/-/color2k-2.0.3.tgz",
|
||||
"integrity": "sha512-zW190nQTIoXcGCaU08DvVNFTmQhUpnJfVuAKfWqUQkflXKpaDdpaYoM0iluLS9lgJNHyBF58KKA2FBEwkD7wog=="
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/compute-scroll-into-view": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.0.3.tgz",
|
||||
@@ -3010,6 +3037,14 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/detect-node-es": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz",
|
||||
@@ -3540,6 +3575,25 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.6",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/for-each": {
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
||||
@@ -3549,6 +3603,19 @@
|
||||
"is-callable": "^1.1.3"
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/framer-motion": {
|
||||
"version": "11.0.15",
|
||||
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.0.15.tgz",
|
||||
@@ -4414,6 +4481,25 @@
|
||||
"loose-envify": "cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
@@ -4751,6 +4837,11 @@
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||
},
|
||||
"node_modules/punycode": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@fontsource/poppins": "^5.0.12",
|
||||
"@gsap/react": "^2.1.0",
|
||||
"axios": "^1.6.8",
|
||||
"framer-motion": "^11.0.15",
|
||||
"react": "^18.2.0",
|
||||
"react-countup": "^6.5.2",
|
||||
|
||||
BIN
src/assets/images/bharat.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
src/assets/images/cwde.png
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
src/assets/images/hdfc.png
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
src/assets/images/irctc.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
src/assets/images/kpmg.png
Normal file
|
After Width: | Height: | Size: 221 KiB |
BIN
src/assets/images/tzero.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
src/assets/images/zing.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
@@ -28,6 +28,7 @@ import discord from "../../assets/images/contactDiscord.png";
|
||||
import forml from "../../assets/images/forml.png";
|
||||
import { Link } from "react-router-dom";
|
||||
import ReCAPTCHA from "react-google-recaptcha";
|
||||
import { contactUs } from "../../service/api";
|
||||
|
||||
const Contact = () => {
|
||||
const {
|
||||
@@ -42,44 +43,33 @@ const Contact = () => {
|
||||
const [recaptchaToken, setRecaptchaToken] = useState(null);
|
||||
const [captchaError, setCaptchaError] = useState("");
|
||||
|
||||
const email = "rubix@gmail.com";
|
||||
// const email = "rubix@gmail.com";
|
||||
|
||||
const handleVerify = (token) => {
|
||||
setRecaptchaToken(token);
|
||||
};
|
||||
|
||||
console.log(errors);
|
||||
const onSubmit = async (data) => {
|
||||
// console.log(data);
|
||||
if (!recaptchaToken) {
|
||||
setCaptchaError("Please complete the reCAPTCHA.");
|
||||
} else {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const formdata = new FormData();
|
||||
formdata.append("email", data.email);
|
||||
formdata.append("phone", data.phone);
|
||||
formdata.append("message", data.message);
|
||||
formdata.append("firstname", data.firstName);
|
||||
formdata.append("lastname", data.lastName);
|
||||
formdata.append("typeofenquiry", data.typeofenquiry);
|
||||
// formdata.append(
|
||||
// "subject",
|
||||
// `Thank you for contacting us | ${data.firstName + " " + data.lastName}`
|
||||
// );
|
||||
for (const pair of formdata.entries()) {
|
||||
console.log(pair[0] + ":", pair[1]);
|
||||
}
|
||||
// formdata.append("html", html);
|
||||
// await contactUs(formdata);
|
||||
setIsLoading(false);
|
||||
} catch (error) {
|
||||
setIsLoading(false);
|
||||
setCaptchaError("Failed to submit the form. Please try again.");
|
||||
console.log(error);
|
||||
// if (!recaptchaToken) {
|
||||
// setCaptchaError("Please complete the reCAPTCHA.");
|
||||
// } else {
|
||||
// setIsLoading(true);
|
||||
|
||||
// reset();
|
||||
// }
|
||||
try {
|
||||
const result = await contactUs(data);
|
||||
if (result.status) {
|
||||
onOpen();
|
||||
}
|
||||
reset();
|
||||
onOpen();
|
||||
setIsLoading(false);
|
||||
} catch (error) {
|
||||
setIsLoading(false);
|
||||
setCaptchaError("Failed to submit the form. Please try again.");
|
||||
console.log(error);
|
||||
}
|
||||
reset();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -334,19 +324,19 @@ const Contact = () => {
|
||||
borderRadius: "5px",
|
||||
}}
|
||||
// placeholder="First Name"
|
||||
{...register("firstName", {
|
||||
{...register("firstname", {
|
||||
pattern: {
|
||||
value: /^[A-Za-z]+$/i,
|
||||
message:
|
||||
"Please enter a valid First Name with only letters",
|
||||
},
|
||||
required: true,
|
||||
required: "First Name is required",
|
||||
maxLength: 20,
|
||||
})}
|
||||
/>
|
||||
{errors.firstName && (
|
||||
{errors.firstname && (
|
||||
<p style={{ fontSize: "13px", color: "red" }}>
|
||||
{errors.firstName.message}
|
||||
{errors.firstname.message}
|
||||
</p>
|
||||
)}
|
||||
</Box>
|
||||
@@ -372,18 +362,18 @@ const Contact = () => {
|
||||
borderRadius: "5px",
|
||||
}}
|
||||
// placeholder="Last Name"
|
||||
{...register("lastName", {
|
||||
{...register("lastname", {
|
||||
pattern: {
|
||||
value: /^[A-Za-z]+$/i,
|
||||
message:
|
||||
"Please enter a valid Last Name with only letters",
|
||||
},
|
||||
required: true,
|
||||
required: "Last Name is required",
|
||||
})}
|
||||
/>
|
||||
{errors.lastName && (
|
||||
{errors.lastname && (
|
||||
<p style={{ fontSize: "13px", color: "red" }}>
|
||||
{errors.lastName.message}
|
||||
{errors.lastname.message}
|
||||
</p>
|
||||
)}
|
||||
</Box>
|
||||
@@ -581,7 +571,7 @@ const Contact = () => {
|
||||
required
|
||||
{...register("message", { required: true })}
|
||||
/>
|
||||
<ReCAPTCHA
|
||||
{/* <ReCAPTCHA
|
||||
style={{ display: "grid", placeContent: "left" }}
|
||||
sitekey="6LfV87gpAAAAAMAAhyjTuaVjS7y6T_dXtMiLhsGJ"
|
||||
onChange={handleVerify}
|
||||
@@ -590,7 +580,7 @@ const Contact = () => {
|
||||
<div style={{ color: "red", fontSize: "1.2rem" }}>
|
||||
{captchaError}
|
||||
</div>
|
||||
)}
|
||||
)} */}
|
||||
<Button
|
||||
type="submit"
|
||||
border={"none"}
|
||||
|
||||
@@ -20,6 +20,13 @@ import ondc from "../../assets/images/ondc.png";
|
||||
import smartcity from "../../assets/images/smartcity.png";
|
||||
import ymca from "../../assets/images/ymca.png";
|
||||
import bescom from "../../assets/images/bescom.png";
|
||||
import kpmg from "../../assets/images/kpmg.png";
|
||||
import cwde from "../../assets/images/cwde.png";
|
||||
import tzero from "../../assets/images/tzero.png";
|
||||
import irctc from "../../assets/images/irctc.png";
|
||||
import hdfc from "../../assets/images/hdfc.png";
|
||||
import bharat from "../../assets/images/bharat.png";
|
||||
import zing from "../../assets/images/zing.png";
|
||||
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
|
||||
@@ -151,11 +158,11 @@ export default function Partner() {
|
||||
"@media (max-width: 996px)": {},
|
||||
}}
|
||||
>
|
||||
<Image src={chainx} sx={imgWidth} />
|
||||
<Image src={jupiter} sx={imgWidth} />
|
||||
<Image src={finalo} sx={imgWidth} />
|
||||
<Image src={ymca} sx={imgWidth} />
|
||||
<Image src={ondc} sx={imgWidth} />
|
||||
<Image src={kpmg} sx={imgWidth} />
|
||||
<Image src={cwde} sx={imgWidth} />
|
||||
<Image src={tzero} sx={imgWidth} />
|
||||
<Image src={irctc} sx={imgWidth} />
|
||||
<Image src={hdfc} sx={imgWidth} />
|
||||
</Box>
|
||||
<Box
|
||||
display={"flex"}
|
||||
@@ -166,8 +173,8 @@ export default function Partner() {
|
||||
"@media (max-width: 996px)": {},
|
||||
}}
|
||||
>
|
||||
<Image src={ensurity} sx={imgWidth} />
|
||||
<Image src={exr} sx={imgWidth} />
|
||||
<Image src={bharat} sx={imgWidth} />
|
||||
<Image src={zing} sx={imgWidth} />
|
||||
<Image src={iskon} sx={imgWidth} />
|
||||
<Image src={smartcity} sx={imgWidth} />
|
||||
<Image src={bescom} sx={imgWidth} />
|
||||
|
||||
18
src/service/api.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import axios from "axios";
|
||||
const API_URL = import.meta.env.VITE_API_BASE_URL;
|
||||
const instance = axios.create({
|
||||
// baseURL:`${process.env.REACT_APP_DB_HOST}api/development/v1`,
|
||||
baseURL: API_URL,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
export const contactUs = async (data) => {
|
||||
try {
|
||||
console.log(data);
|
||||
return await instance.post('/api/contactUs', data)
|
||||
} catch (error) {
|
||||
throw new Error("Failed Error occure :" + error.response?.data?.message)
|
||||
}
|
||||
}
|
||||