Skip to content

Commit

Permalink
Merge pull request #41 from ZFGCCP/feature/registration/reg-fix
Browse files Browse the repository at this point in the history
registration fixes
  • Loading branch information
MGZero authored Dec 23, 2020
2 parents 300bfdc + 4aac619 commit e2ed1d4
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/assets/style/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,10 @@ $border-stroke: .2em;
}
}
}

label{
&.green{
color: $green1;
}
}
}
36 changes: 36 additions & 0 deletions src/components/registration/post-registration.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import ZfgcForm from './../forms/ZfgcForm.component.js';
import Collapsible from './../collapsible/collapsible.component.js';
import Button from 'react-bootstrap/Button';
import Form from 'react-bootstrap/Form';
import {Link} from "react-router-dom";
import { faCheckCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'

class PostRegistration extends React.Component {
componentDidMount(){

}

render () {
return (
<div className="justify-content-center d-flex">
<Collapsible>
<div className="sign-in-form">
<form className="zfgc-form" onSubmit={this.handleSubmit}>
<div className="d-flex flex-column">
<label className="green"><FontAwesomeIcon icon={faCheckCircle}/> You have successfully registered a new account. An activation email has been sent to you.</label>

<Form.Group>
<Button variant="secondary">Go Home</Button>
</Form.Group>
</div>
</form>
</div>
</Collapsible>
</div>
)
}
}

export default PostRegistration;
10 changes: 9 additions & 1 deletion src/components/registration/registration.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import LookupEndpoints from './../../utilities/axios/lookups.endpoints.js';
import jstz from 'jstz';
import ZfgcForm from './../forms/ZfgcForm.component.js';
import DatePicker from "react-datepicker";
import { Redirect } from "react-router-dom";

class Registration extends ZfgcForm {

Expand Down Expand Up @@ -37,7 +38,9 @@ class Registration extends ZfgcForm {
}
else{
UserEndpoints.registerNewUser(super.getState().vm).then((data) => {
console.log("user response");
let state = super.getState();
state.redirect = true;
super.setState(state);
});
}
};
Expand All @@ -46,6 +49,11 @@ class Registration extends ZfgcForm {

return (
<div className="justify-content-center d-flex">
{super.getState() && super.getState().redirect ?
<Redirect to="/registration/success"/> :
""
}

<Collapsible>
<div className="sign-in-form">
<Form noValidate className="zfgc-form" onSubmit={this.handleSubmit}>
Expand Down
4 changes: 4 additions & 0 deletions src/routing/new-user.route.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import TosForm from './../components/registration/tos.component.js';
import Registration from './../components/registration/registration.component.js';
import PostRegistration from './../components/registration/post-registration.component.js';
import {
BrowserRouter as Router,
Switch,
Expand All @@ -20,6 +21,9 @@ function NewUserRoute() {
<Route path={path + "/new-user"}>
<Registration/>
</Route>
<Route path={path + "/success"}>
<PostRegistration/>
</Route>
</Router>
</Switch>
</div>
Expand Down

0 comments on commit e2ed1d4

Please sign in to comment.