ntasicc pirms 3 gadiem
vecāks
revīzija
3d6f245ac2

+ 7
- 2
frontend/src/components/shared/ClientForm.jsx Parādīt failu

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 captchaRef = useRef(null);
const captchaRef2 = useRef(null);
const [msgText, setMsgText] = useState(''); const [msgText, setMsgText] = useState('');
const changeFormHandler = event => { const changeFormHandler = event => {
const { name, value } = event.target; const { name, value } = event.target;
Lastname: values.lastName, Lastname: values.lastName,
Description: values.description, Description: values.description,
}; };
const token = captchaRef.current.getValue();
const token =
captchaRef.current.getValue() || captchaRef2.current.getValue();
captchaRef.current.reset(); captchaRef.current.reset();
captchaRef2.current.reset();

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

+ 6
- 2
frontend/src/components/shared/JobForm.jsx Parādīt failu

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 captchaRef = useRef(null);
const captchaRef2 = useRef(null);
const [msgText, setMsgText] = useState(''); const [msgText, setMsgText] = useState('');
const cntCareersJobs = props.cntCareers; const cntCareersJobs = props.cntCareers;
let defaultPositionSelection = props.defaultPositionSelection; let defaultPositionSelection = props.defaultPositionSelection;
File: res, File: res,
}; };


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

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

Notiek ielāde…
Atcelt
Saglabāt