Kaynağa Gözat

Google reCAPTCHA

strapiSEO
ntasicc 3 yıl önce
ebeveyn
işleme
742c435641

+ 2
- 1
frontend/.env Dosyayı Görüntüle

//http://localhost:1337 //http://localhost:1337
MAILCHIMP_FORM_URL = http://eepurl.com/iaRrv1 MAILCHIMP_FORM_URL = http://eepurl.com/iaRrv1
GOOGLE_TRACKING_ID = "G-PTZC3WLTZ1" GOOGLE_TRACKING_ID = "G-PTZC3WLTZ1"
REACT_APP_MEASUREMENT_ID = G-PD7YZVDG30
REACT_APP_MEASUREMENT_ID = G-PD7YZVDG30
REACT_APP_SITE_KEY = 6LdCnHgjAAAAAAV4z_GBHwLYdKhxE9Y3oBzO6cxK

+ 45
- 2
frontend/package-lock.json Dosyayı Görüntüle

{ {
"name": "frontend", "name": "frontend",
"version": "1.1.6",
"version": "1.1.8",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "frontend", "name": "frontend",
"version": "1.1.6",
"version": "1.1.8",
"dependencies": { "dependencies": {
"@faceless-ui/slider": "^1.1.14", "@faceless-ui/slider": "^1.1.14",
"@faceless-ui/window-info": "^2.1.1", "@faceless-ui/window-info": "^2.1.1",
"react-dropzone": "^12.0.5", "react-dropzone": "^12.0.5",
"react-ga": "^3.3.1", "react-ga": "^3.3.1",
"react-ga4": "^1.4.1", "react-ga4": "^1.4.1",
"react-google-recaptcha": "^2.1.0",
"react-mailchimp-subscribe": "^2.1.3", "react-mailchimp-subscribe": "^2.1.3",
"react-markdown": "^8.0.0", "react-markdown": "^8.0.0",
"react-router-dom": "^6.2.1", "react-router-dom": "^6.2.1",
"node": ">=14" "node": ">=14"
} }
}, },
"node_modules/react-async-script": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/react-async-script/-/react-async-script-1.2.0.tgz",
"integrity": "sha512-bCpkbm9JiAuMGhkqoAiC0lLkb40DJ0HOEJIku+9JDjxX3Rcs+ztEOG13wbrOskt3n2DTrjshhaQ/iay+SnGg5Q==",
"dependencies": {
"hoist-non-react-statics": "^3.3.0",
"prop-types": "^15.5.0"
},
"peerDependencies": {
"react": ">=16.4.1"
}
},
"node_modules/react-cookie": { "node_modules/react-cookie": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz", "resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz",
"resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-1.4.1.tgz", "resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-1.4.1.tgz",
"integrity": "sha512-ioBMEIxd4ePw4YtaloTUgqhQGqz5ebDdC4slEpLgy2sLx1LuZBC9iYCwDymTXzcntw6K1dHX183ulP32nNdG7w==" "integrity": "sha512-ioBMEIxd4ePw4YtaloTUgqhQGqz5ebDdC4slEpLgy2sLx1LuZBC9iYCwDymTXzcntw6K1dHX183ulP32nNdG7w=="
}, },
"node_modules/react-google-recaptcha": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/react-google-recaptcha/-/react-google-recaptcha-2.1.0.tgz",
"integrity": "sha512-K9jr7e0CWFigi8KxC3WPvNqZZ47df2RrMAta6KmRoE4RUi7Ys6NmNjytpXpg4HI/svmQJLKR+PncEPaNJ98DqQ==",
"dependencies": {
"prop-types": "^15.5.0",
"react-async-script": "^1.1.1"
},
"peerDependencies": {
"react": ">=16.4.1"
}
},
"node_modules/react-is": { "node_modules/react-is": {
"version": "16.13.1", "version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"whatwg-fetch": "^3.6.2" "whatwg-fetch": "^3.6.2"
} }
}, },
"react-async-script": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/react-async-script/-/react-async-script-1.2.0.tgz",
"integrity": "sha512-bCpkbm9JiAuMGhkqoAiC0lLkb40DJ0HOEJIku+9JDjxX3Rcs+ztEOG13wbrOskt3n2DTrjshhaQ/iay+SnGg5Q==",
"requires": {
"hoist-non-react-statics": "^3.3.0",
"prop-types": "^15.5.0"
}
},
"react-cookie": { "react-cookie": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz", "resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz",
"resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-1.4.1.tgz", "resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-1.4.1.tgz",
"integrity": "sha512-ioBMEIxd4ePw4YtaloTUgqhQGqz5ebDdC4slEpLgy2sLx1LuZBC9iYCwDymTXzcntw6K1dHX183ulP32nNdG7w==" "integrity": "sha512-ioBMEIxd4ePw4YtaloTUgqhQGqz5ebDdC4slEpLgy2sLx1LuZBC9iYCwDymTXzcntw6K1dHX183ulP32nNdG7w=="
}, },
"react-google-recaptcha": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/react-google-recaptcha/-/react-google-recaptcha-2.1.0.tgz",
"integrity": "sha512-K9jr7e0CWFigi8KxC3WPvNqZZ47df2RrMAta6KmRoE4RUi7Ys6NmNjytpXpg4HI/svmQJLKR+PncEPaNJ98DqQ==",
"requires": {
"prop-types": "^15.5.0",
"react-async-script": "^1.1.1"
}
},
"react-is": { "react-is": {
"version": "16.13.1", "version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",

+ 2
- 1
frontend/package.json Dosyayı Görüntüle

{ {
"name": "frontend", "name": "frontend",
"version": "1.1.8",
"version": "1.1.9",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@faceless-ui/slider": "^1.1.14", "@faceless-ui/slider": "^1.1.14",
"react-dropzone": "^12.0.5", "react-dropzone": "^12.0.5",
"react-ga": "^3.3.1", "react-ga": "^3.3.1",
"react-ga4": "^1.4.1", "react-ga4": "^1.4.1",
"react-google-recaptcha": "^2.1.0",
"react-mailchimp-subscribe": "^2.1.3", "react-mailchimp-subscribe": "^2.1.3",
"react-markdown": "^8.0.0", "react-markdown": "^8.0.0",
"react-router-dom": "^6.2.1", "react-router-dom": "^6.2.1",

+ 45
- 19
frontend/src/components/shared/ClientForm.jsx Dosyayı Görüntüle

import React, { useRef } from 'react';
import TagInput from '../TagInput'; import TagInput from '../TagInput';
import img from '../../assets/images/Inqueries.png'; import img from '../../assets/images/Inqueries.png';
import * as Yup from 'yup'; import * as Yup from 'yup';
import * as emailjs from 'emailjs-com'; import * as emailjs from 'emailjs-com';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import ReactGA from 'react-ga4'; import ReactGA from 'react-ga4';
import ReCAPTCHA from 'react-google-recaptcha';
import axios from 'axios';


export default function ClientForm() { export default function ClientForm() {
//search context for prevous entry TODO //search context for prevous entry TODO
const { clientForm, setClientForm } = useContext(ClientFormContext); const { clientForm, setClientForm } = useContext(ClientFormContext);
const [sucMsg, setSucMsg] = useState(false); const [sucMsg, setSucMsg] = useState(false);

const captchaRef = useRef(null);
const [msgText, setMsgText] = useState('');
const changeFormHandler = event => { const changeFormHandler = event => {
const { name, value } = event.target; const { name, value } = event.target;
setClientForm({ setClientForm({
<Formik <Formik
initialValues={clientForm} initialValues={clientForm}
validationSchema={validationSchema} validationSchema={validationSchema}
onSubmit={values => {
onSubmit={async values => {
const data = { const data = {
Tag: values.tag, Tag: values.tag,
Subject: values.subject, Subject: values.subject,
Description: values.description, Description: values.description,
}; };


emailjs
.send(
process.env.REACT_APP_SERVICE_ID,
process.env.REACT_APP_CLIENT_TEMPLATE_ID,
data,
process.env.REACT_APP_USER_ID,
)
.then(
result => {
console.log(result.text);
const token = captchaRef.current.getValue();
captchaRef.current.reset();
if (token.length === 0) {
setSucMsg(true);
setMsgText('Please fill reCAPTCHA and try again. Thank you!');
} else {
await axios
.post('http://localhost:2000/verify-token', { token })
.then(res => {
setSucMsg(true); setSucMsg(true);
},
error => {
console.log(error.text);
},
);
if (res.data.data.success)
setMsgText('Submission Succesful! Thank you!');
else setMsgText('Please fill reCAPTCHA and try again. Thank you!');
})
.catch(error => {
console.log(error);
});
}

// emailjs
// .send(
// process.env.REACT_APP_SERVICE_ID,
// process.env.REACT_APP_CLIENT_TEMPLATE_ID,
// data,
// process.env.REACT_APP_USER_ID,
// )
// .then(
// result => {
// console.log(result.text);
// setSucMsg(true);
// },
// error => {
// console.log(error.text);
// },
// );
ReactGA.event('contact', { ReactGA.event('contact', {
category: 'Contact', category: 'Contact',
action: 'Business Inquiry', action: 'Business Inquiry',
/> />
</div> </div>
</div> </div>

<ReCAPTCHA
sitekey={process.env.REACT_APP_SITE_KEY}
ref={captchaRef}
/>
<div className=" py-3 text-right"> <div className=" py-3 text-right">
<button <button
type="submit" type="submit"
</div> </div>
{sucMsg && ( {sucMsg && (
<div className={'text-sm text-right text-dg-primary-900'}> <div className={'text-sm text-right text-dg-primary-900'}>
Submission Succesful! Thank you!
{msgText}
</div> </div>
)} )}
</div> </div>

+ 1
- 1
frontend/src/components/shared/CookieBanner.jsx Dosyayı Görüntüle

{cookie_p} {cookie_p}
</p> </p>
</div> </div>
<div className="max-w-banner w-full flex items-center justify-end p-0 gap-2.5">
<div className="max-w-banner w-full flex items-center justify-end p-0 md:gap-2.5">
<button <button
onClick={handleDecline} onClick={handleDecline}
className="flex items-start p-0 text-dg-primary-900 bg-dg-primary-75 font-semibold font-secondary md:px-64p px-42p md:py-20p py-15p md:w-max w-36 whitespace-nowrap" className="flex items-start p-0 text-dg-primary-900 bg-dg-primary-75 font-semibold font-secondary md:px-64p px-42p md:py-20p py-15p md:w-max w-36 whitespace-nowrap"

+ 47
- 18
frontend/src/components/shared/JobForm.jsx Dosyayı Görüntüle

import ReactGA from 'react-ga4'; import ReactGA from 'react-ga4';
import MyDropzone from './MyDropzone'; import MyDropzone from './MyDropzone';
import HashPositions from './HashPositions'; import HashPositions from './HashPositions';
import ReCAPTCHA from 'react-google-recaptcha';
import axios from 'axios';


export default function JobForm(props) { export default function JobForm(props) {
const [sucMsg, setSucMsg] = useState(false); const [sucMsg, setSucMsg] = useState(false);
const captchaRef = useRef(null);
const [msgText, setMsgText] = useState('');
const cntCareersJobs = props.cntCareers; const cntCareersJobs = props.cntCareers;
let defaultPositionSelection = props.defaultPositionSelection; let defaultPositionSelection = props.defaultPositionSelection;
//search context for prevous entry TODO //search context for prevous entry TODO
initialValues={jobForm} initialValues={jobForm}
validationSchema={validationSchema} validationSchema={validationSchema}
onChange={changeFormHandler} onChange={changeFormHandler}
onSubmit={values => {
onSubmit={async values => {
const prepFile = async file => { const prepFile = async file => {
if (file.size >= 2000000) { if (file.size >= 2000000) {
setErrorMsg('File too large!'); setErrorMsg('File too large!');
setErrorMsg('CV is Required'); setErrorMsg('CV is Required');
} else { } else {
setErrorMsg(''); setErrorMsg('');
prepFile(jobForm.file).then(res => {
prepFile(jobForm.file).then(async res => {
const newtemplateParams = { const newtemplateParams = {
Position: values.position, Position: values.position,
Other: values.other, Other: values.other,
File: res, File: res,
}; };


emailjs
.send(
process.env.REACT_APP_SERVICE_ID,
process.env.REACT_APP_JOB_TEMPLATE_ID,
newtemplateParams,
process.env.REACT_APP_USER_ID,
)
.then(
result => {
console.log(result.text);
const token = captchaRef.current.getValue();
captchaRef.current.reset();
if (token.length === 0) {
setSucMsg(true);
setMsgText('Please fill reCAPTCHA and try again. Thank you!');
} else {
await axios
.post('http://localhost:2000/verify-token', { token })
.then(res => {
setSucMsg(true); setSucMsg(true);
},
error => {
console.log(error.text);
},
);
if (res.data.data.success)
setMsgText('Submission Succesful! Thank you!');
else
setMsgText('Please fill reCAPTCHA and try again. Thank you!');
})
.catch(error => {
console.log(error);
});
}

// emailjs
// .send(
// process.env.REACT_APP_SERVICE_ID,
// process.env.REACT_APP_JOB_TEMPLATE_ID,
// newtemplateParams,
// process.env.REACT_APP_USER_ID,
// )
// .then(
// result => {
// console.log(result.text);
// setSucMsg(true);
// },
// error => {
// console.log(error.text);
// },
// );
}); });
} }
ReactGA.event('contact', { ReactGA.event('contact', {
</div> </div>
</div> </div>


<ReCAPTCHA
sitekey={process.env.REACT_APP_SITE_KEY}
ref={captchaRef}
/>

<div className=" py-3 text-right"> <div className=" py-3 text-right">
<button <button
type="submit" type="submit"
</div> </div>
{sucMsg && ( {sucMsg && (
<div className={'text-sm text-right text-dg-primary-900'}> <div className={'text-sm text-right text-dg-primary-900'}>
Submission Succesful! Thank you!
{msgText}
</div> </div>
)} )}
</div> </div>

+ 18
- 2
frontend/yarn.lock Dosyayı Görüntüle

"kleur" "^3.0.3" "kleur" "^3.0.3"
"sisteransi" "^1.0.5" "sisteransi" "^1.0.5"


"prop-types@^15.0.0", "prop-types@^15.5.10", "prop-types@^15.6.0", "prop-types@^15.7.2", "prop-types@^15.8.1":
"prop-types@^15.0.0", "prop-types@^15.5.0", "prop-types@^15.5.10", "prop-types@^15.6.0", "prop-types@^15.7.2", "prop-types@^15.8.1":
"integrity" "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==" "integrity" "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="
"resolved" "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz" "resolved" "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz"
"version" "15.8.1" "version" "15.8.1"
"regenerator-runtime" "^0.13.9" "regenerator-runtime" "^0.13.9"
"whatwg-fetch" "^3.6.2" "whatwg-fetch" "^3.6.2"


"react-async-script@^1.1.1":
"integrity" "sha512-bCpkbm9JiAuMGhkqoAiC0lLkb40DJ0HOEJIku+9JDjxX3Rcs+ztEOG13wbrOskt3n2DTrjshhaQ/iay+SnGg5Q=="
"resolved" "https://registry.npmjs.org/react-async-script/-/react-async-script-1.2.0.tgz"
"version" "1.2.0"
dependencies:
"hoist-non-react-statics" "^3.3.0"
"prop-types" "^15.5.0"

"react-cookie@^4.1.1": "react-cookie@^4.1.1":
"integrity" "sha512-ffn7Y7G4bXiFbnE+dKhHhbP+b8I34mH9jqnm8Llhj89zF4nPxPutxHT1suUqMeCEhLDBI7InYwf1tpaSoK5w8A==" "integrity" "sha512-ffn7Y7G4bXiFbnE+dKhHhbP+b8I34mH9jqnm8Llhj89zF4nPxPutxHT1suUqMeCEhLDBI7InYwf1tpaSoK5w8A=="
"resolved" "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz" "resolved" "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz"
"resolved" "https://registry.npmjs.org/react-ga4/-/react-ga4-1.4.1.tgz" "resolved" "https://registry.npmjs.org/react-ga4/-/react-ga4-1.4.1.tgz"
"version" "1.4.1" "version" "1.4.1"


"react-google-recaptcha@^2.1.0":
"integrity" "sha512-K9jr7e0CWFigi8KxC3WPvNqZZ47df2RrMAta6KmRoE4RUi7Ys6NmNjytpXpg4HI/svmQJLKR+PncEPaNJ98DqQ=="
"resolved" "https://registry.npmjs.org/react-google-recaptcha/-/react-google-recaptcha-2.1.0.tgz"
"version" "2.1.0"
dependencies:
"prop-types" "^15.5.0"
"react-async-script" "^1.1.1"

"react-is@^16.13.1", "react-is@^16.7.0", "react-is@>= 16.8.0": "react-is@^16.13.1", "react-is@^16.7.0", "react-is@>= 16.8.0":
"integrity" "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" "integrity" "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
"resolved" "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" "resolved" "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
optionalDependencies: optionalDependencies:
"fsevents" "^2.3.2" "fsevents" "^2.3.2"


"react@*", "react@^15.6.2 || ^16.0 || ^17 || ^18", "react@^16 || ^17 || ^18", "react@^16.8 || ^17 || ^18", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.2", "react@>= 16", "react@>= 16.3.0", "react@>= 16.8", "react@>= 16.8.0", "react@>=15", "react@>=16", "react@>=16.8", "react@>=16.8 || ^17.0.0 || ^18.0.0", "react@>=16.8.0", "react@17.0.2":
"react@*", "react@^15.6.2 || ^16.0 || ^17 || ^18", "react@^16 || ^17 || ^18", "react@^16.8 || ^17 || ^18", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.2", "react@>= 16", "react@>= 16.3.0", "react@>= 16.8", "react@>= 16.8.0", "react@>=15", "react@>=16", "react@>=16.4.1", "react@>=16.8", "react@>=16.8 || ^17.0.0 || ^18.0.0", "react@>=16.8.0", "react@17.0.2":
"integrity" "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==" "integrity" "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA=="
"resolved" "https://registry.npmjs.org/react/-/react-17.0.2.tgz" "resolved" "https://registry.npmjs.org/react/-/react-17.0.2.tgz"
"version" "17.0.2" "version" "17.0.2"

Loading…
İptal
Kaydet