11import { Formik } from "formik" ;
22import React , { JSX } from "react" ;
33import { createRoot } from "react-dom/client" ;
4- import ReCAPTCHA from "react-google-recaptcha" ;
54import * as Yup from "yup" ;
5+ import MTCaptcha from "./MTCaptcha" ;
66import { getPageProps } from "../utils" ;
77import {
88 AuthCardContainer ,
@@ -12,15 +12,15 @@ import {
1212import ConditionsModal from "./ConditionsModal" ;
1313
1414type SignupUserProps = {
15- recaptcha_site_key : string ;
15+ mtcaptcha_site_key : string ;
1616 csrf_token : string ;
1717 initial_form_data : any ;
1818 initial_errors : any ;
1919} ;
2020
2121function SignupUser ( {
2222 csrf_token,
23- recaptcha_site_key ,
23+ mtcaptcha_site_key ,
2424 initial_form_data,
2525 initial_errors,
2626} : SignupUserProps ) : JSX . Element {
@@ -36,7 +36,7 @@ function SignupUser({
3636 email : initial_form_data . email ?? "" ,
3737 password : initial_form_data . password ?? "" ,
3838 confirm_password : initial_form_data . confirm_password ?? "" ,
39- recaptcha : "" ,
39+ mtcaptcha : "" ,
4040 csrf_token,
4141 } }
4242 initialErrors = { initial_errors }
@@ -58,11 +58,11 @@ function SignupUser({
5858 [ Yup . ref ( "password" ) ] ,
5959 "Confirm Password should match password!"
6060 ) ,
61- recaptcha : Yup . string ( ) . required ( ) ,
61+ mtcaptcha : Yup . string ( ) . required ( ) ,
6262 } ) }
6363 onSubmit = { ( ) => { } }
6464 >
65- { ( { errors, setFieldValue, isValid, dirty } ) => (
65+ { ( { errors, setFieldValue, isValid, dirty, values } ) => (
6666 < form method = "POST" >
6767 < div className = "form-group" >
6868 < div className = "col-sm-offset-4 col-sm-5" >
@@ -141,10 +141,10 @@ function SignupUser({
141141 width : "fit-content" ,
142142 } }
143143 >
144- < ReCAPTCHA
145- sitekey = { recaptcha_site_key }
146- onChange = { ( value ) => setFieldValue ( "recaptcha" , value ) }
144+ < MTCaptcha
145+ sitekey = { mtcaptcha_site_key }
147146 size = "compact"
147+ fieldName = "mtcaptcha"
148148 />
149149 </ div >
150150
@@ -170,13 +170,13 @@ function SignupUser({
170170
171171document . addEventListener ( "DOMContentLoaded" , ( ) => {
172172 const { domContainer, reactProps } = getPageProps ( ) ;
173- const { recaptcha_site_key , csrf_token, initial_form_data, initial_errors } =
173+ const { mtcaptcha_site_key , csrf_token, initial_form_data, initial_errors } =
174174 reactProps ;
175175
176176 const renderRoot = createRoot ( domContainer ! ) ;
177177 renderRoot . render (
178178 < SignupUser
179- recaptcha_site_key = { recaptcha_site_key }
179+ mtcaptcha_site_key = { mtcaptcha_site_key }
180180 csrf_token = { csrf_token }
181181 initial_form_data = { initial_form_data }
182182 initial_errors = { initial_errors }
0 commit comments