Explorar el Código

typo

strapiSEO
ntasicc hace 3 años
padre
commit
3d6f245ac2

+ 7
- 2
frontend/src/components/shared/ClientForm.jsx Ver fichero

@@ -16,6 +16,7 @@ export default function ClientForm() {
const { clientForm, setClientForm } = useContext(ClientFormContext);
const [sucMsg, setSucMsg] = useState(false);
const captchaRef = useRef(null);
const captchaRef2 = useRef(null);
const [msgText, setMsgText] = useState('');
const changeFormHandler = event => {
const { name, value } = event.target;
@@ -67,8 +68,12 @@ export default function ClientForm() {
Lastname: values.lastName,
Description: values.description,
};
const token = captchaRef.current.getValue();
const token =
captchaRef.current.getValue() || captchaRef2.current.getValue();
captchaRef.current.reset();
captchaRef2.current.reset();

console.log(token);
if (token.length === 0) {
setSucMsg(true);
setMsgText('Please fill reCAPTCHA and try again. Thank you!');
@@ -247,7 +252,7 @@ export default function ClientForm() {
<div className="flex items-center justify-end sm:hidden">
<ReCAPTCHA
sitekey={process.env.REACT_APP_SITE_KEY}
ref={captchaRef}
ref={captchaRef2}
size="compact"
/>
</div>

+ 6
- 2
frontend/src/components/shared/JobForm.jsx Ver fichero

@@ -16,6 +16,7 @@ import axios from 'axios';
export default function JobForm(props) {
const [sucMsg, setSucMsg] = useState(false);
const captchaRef = useRef(null);
const captchaRef2 = useRef(null);
const [msgText, setMsgText] = useState('');
const cntCareersJobs = props.cntCareers;
let defaultPositionSelection = props.defaultPositionSelection;
@@ -169,8 +170,11 @@ export default function JobForm(props) {
File: res,
};

const token = captchaRef.current.getValue();
const token =
captchaRef.current.getValue() || captchaRef2.current.getValue();
captchaRef.current.reset();
captchaRef2.current.reset();

if (token.length === 0) {
setSucMsg(true);
setMsgText('Please fill reCAPTCHA and try again. Thank you!');
@@ -441,7 +445,7 @@ export default function JobForm(props) {
<div className="flex items-center justify-end sm:hidden">
<ReCAPTCHA
sitekey={process.env.REACT_APP_SITE_KEY}
ref={captchaRef}
ref={captchaRef2}
size="compact"
/>
</div>

Cargando…
Cancelar
Guardar