Clean up errors

This commit is contained in:
Paulo Gustavo Veiga 2020-12-06 09:02:57 -08:00
parent e243abe252
commit 44e321be34
4 changed files with 26 additions and 13 deletions

View File

@ -4,17 +4,17 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <!-- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="WiseMappping" /> <meta name="description" content="WiseMappping" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon.png" /> <!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon.png" /> -->
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> -->
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>WiseMappping - Login</title> <title>WiseMappping - Loading ...</title>
</head> </head>
<body> <body>

View File

@ -11,9 +11,8 @@ interface HeaderProps {
class Header extends React.Component<HeaderProps, HeaderProps> { class Header extends React.Component<HeaderProps, HeaderProps> {
constructor(props: HeaderProps) { constructor(props: HeaderProps) {
super(props); super(props);
this.state = props; this.state = { type: props.type };
} }
render() { render() {
let signUpButton; let signUpButton;
let signInButton; let signInButton;
@ -34,7 +33,7 @@ class Header extends React.Component<HeaderProps, HeaderProps> {
return ( return (
<nav> <nav>
<div className="header"> <div className="header">
<span className="header-logo"><Link to="/"><img src={String(logo)} alt="logo" /></Link></span> <span className="header-logo"><Link to="/"><img src={String(logo)} alt="logo" /></a></span>
{text} {text}
{signUpButton} {signUpButton}
{signInButton} {signInButton}
@ -51,7 +50,7 @@ interface ButtonProps {
const SignInButton = (props: ButtonProps) => { const SignInButton = (props: ButtonProps) => {
return ( return (
<span className={`button-style1 ${props.className}`}> <span className={`button-style1 ${props.className}`}>
<a href="/c/login"><FormattedMessage id="login.signin" defaultMessage="Sign In" /></a> <Link to="/c/login"><FormattedMessage id="login.signin" defaultMessage="Sign In" /></Link>
</span>); </span>);
} }

View File

@ -39,11 +39,26 @@ const RegistrationForm = () => {
const [lastName, setLastname] = useState("") const [lastName, setLastname] = useState("")
const [firstname, setFirstname] = useState(""); const [firstname, setFirstname] = useState("");
const [password, setPassword] = useState(""); const [password, setPassword] = useState("");
const [recaptchaToken, setRecaptchaToken] = useState(undefined);
const [recaptcha, setRecaptcha] = useState(undefined); const [recaptcha, setRecaptcha] = useState(undefined);
const [errorMsg, setErrorMsg] = useState(undefined); const [errorMsg, setErrorMsg] = useState(undefined);
const history = useHistory(); const history = useHistory();
const intl = useIntl(); const intl = useIntl();
const verifyCallback = (recaptchaToken:string) => {
// Here you will get the final recaptchaToken!!!
console.log(recaptchaToken, "<= your recaptcha token");
setRecaptchaToken(recaptchaToken);
}
const updateToken = () => {
// you will get a new token in verifyCallback
recaptcha.execute();
}
const handleSubmit = async (event: React.FormEvent) => { const handleSubmit = async (event: React.FormEvent) => {
event.preventDefault(); event.preventDefault();
@ -54,7 +69,7 @@ const RegistrationForm = () => {
firstName: firstname, firstName: firstname,
lastName: lastName, lastName: lastName,
password: password, password: password,
recaptcha: recaptcha recaptcha: recaptchaToken
} }
); );
@ -75,8 +90,6 @@ const RegistrationForm = () => {
}); });
} }
return ( return (
<div className="wrapper"> <div className="wrapper">
<div className="content"> <div className="content">
@ -93,9 +106,10 @@ const RegistrationForm = () => {
<div> <div>
<ReCaptcha <ReCaptcha
ref={setRecaptcha}
sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"
verifyCallback={setRecaptcha} verifyCallback={setRecaptcha}
/> na/>
</div> </div>
<p> <p>
<FormattedMessage id="registration.termandconditions" defaultMessage="Terms of Service: Please check the WiseMapping Account information you've entered above, and review the Terms of Service here. By clicking on 'Register' below you are agreeing to the Terms of Service above and the Privacy Policy" /> <FormattedMessage id="registration.termandconditions" defaultMessage="Terms of Service: Please check the WiseMapping Account information you've entered above, and review the Terms of Service here. By clicking on 'Register' below you are agreeing to the Terms of Service above and the Privacy Policy" />

View File

@ -55,6 +55,6 @@ module.exports = {
contentBase: path.join(__dirname, 'dist'), contentBase: path.join(__dirname, 'dist'),
compress: true, compress: true,
port: 3000, port: 3000,
hot: true, hot: true
} }
} }