Ver código fonte

typo

strapiSEO
ntasicc 3 anos atrás
pai
commit
7c84cc51b8

+ 2
- 13
frontend/src/components/shared/ClientForm.jsx Ver arquivo

@@ -16,7 +16,6 @@ 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;
@@ -68,12 +67,9 @@ export default function ClientForm() {
Lastname: values.lastName,
Description: values.description,
};
const token =
captchaRef.current.getValue() || captchaRef2.current.getValue();
const token = captchaRef.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!');
@@ -243,19 +239,12 @@ export default function ClientForm() {
/>
</div>
</div>
<div className="items-center justify-end hidden sm:flex">
<div className="items-center justify-end flex">
<ReCAPTCHA
sitekey={process.env.REACT_APP_SITE_KEY}
ref={captchaRef}
/>
</div>
<div className="flex items-center justify-end sm:hidden">
<ReCAPTCHA
sitekey={process.env.REACT_APP_SITE_KEY}
ref={captchaRef2}
size="compact"
/>
</div>
<div className=" py-3 text-right">
<button
type="submit"

+ 2
- 12
frontend/src/components/shared/JobForm.jsx Ver arquivo

@@ -16,7 +16,6 @@ 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;
@@ -170,10 +169,8 @@ export default function JobForm(props) {
File: res,
};

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

if (token.length === 0) {
setSucMsg(true);
@@ -436,19 +433,12 @@ export default function JobForm(props) {
<div className="text-sm text-right">{errorMsg}</div>
</div>
</div>
<div className="items-center justify-end hidden sm:flex">
<div className="items-center justify-end flex">
<ReCAPTCHA
sitekey={process.env.REACT_APP_SITE_KEY}
ref={captchaRef}
/>
</div>
<div className="flex items-center justify-end sm:hidden">
<ReCAPTCHA
sitekey={process.env.REACT_APP_SITE_KEY}
ref={captchaRef2}
size="compact"
/>
</div>
<div className=" py-3 text-right">
<button
type="submit"

Carregando…
Cancelar
Salvar