-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from andela/ft-signup-register-165305221
#165305221 Users should be able to Signup
- Loading branch information
Showing
44 changed files
with
1,202 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"presets": ["@babel/env", "@babel/preset-react"], | ||
"plugins": [ | ||
[ | ||
"@babel/plugin-proposal-class-properties", | ||
{ | ||
"loose": true | ||
} | ||
] | ||
[ | ||
"@babel/plugin-proposal-class-properties", | ||
{ | ||
"loose": true | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import axios from 'axios'; | ||
/* istanbul ignore file */ | ||
import store from './src/redux/store'; | ||
/* istanbul ignore file */ | ||
import BASE_URL from './src/redux/constants'; | ||
/* istanbul ignore file */ | ||
import 'babel-polyfill'; | ||
/* istanbul ignore file */ | ||
|
||
// configure base url | ||
const instance = axios.create({ | ||
baseURL: BASE_URL, | ||
}); | ||
|
||
// intercept requests and add authorization token | ||
instance.interceptors.request.use(config => { | ||
const token = store.getState().auth.token; | ||
if (token) { | ||
config.headers.authorization = `Bearer ${token}`; | ||
} | ||
return config; | ||
}); | ||
|
||
export default instance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.emailsent-page { | ||
h1 { | ||
text-align: center; | ||
margin-top: 2%; | ||
} | ||
|
||
.emailsent-view { | ||
display: flex; | ||
align-items: center; | ||
display: inline-block; | ||
-moz-box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5); | ||
-webkit-box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5); | ||
box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5); | ||
padding: 50px 90px 50px 90px; | ||
width: 40%; | ||
height: 75%; | ||
margin: auto; | ||
display: flex; | ||
justify-content: space-between; | ||
flex-direction: column; | ||
margin-top: 2%; | ||
border-radius: 5px; | ||
} | ||
|
||
.footer { | ||
display: flex; | ||
justify-content: center; | ||
&-home { | ||
font-size: 20px; | ||
margin-right: 15px; | ||
margin-top: 1%; | ||
} | ||
&-login { | ||
font-size: 20px; | ||
margin-top: 1%; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import './variables.scss'; | ||
.navbar-light { | ||
background-color: white !important; | ||
box-shadow: $box-shadow; | ||
|
||
.logo { | ||
width: 3%; | ||
height: 3%; | ||
margin-left: 5px; | ||
margin-right: 15px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@import url('https://fonts.googleapis.com/css?family=Josefin+Sans:300&display=swap'); | ||
body { | ||
font-family: ‘Josefin Sans’, cursive; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@import './variables.scss'; | ||
.signup-page { | ||
h1 { | ||
text-align: center; | ||
margin-top: 2%; | ||
} | ||
.hidden { | ||
display: none; | ||
} | ||
.show { | ||
display: block; | ||
} | ||
@media (min-width: 992px) { | ||
.signup-form { | ||
display: inline-block; | ||
box-shadow: $box-shadow; | ||
padding: 70px 80px 40px 80px; | ||
width: 40%; | ||
height: 75%; | ||
margin: auto; | ||
display: flex; | ||
justify-content: space-between; | ||
flex-direction: column; | ||
margin-top: 1%; | ||
border-radius: 5px; | ||
} | ||
} | ||
.separator { | ||
display: flex; | ||
align-items: center; | ||
&-line { | ||
height: 2px; | ||
background: $background; | ||
width: 48%; | ||
} | ||
&-text { | ||
background: transparent; | ||
border-radius: 50%; | ||
margin: 0 5px 0 5px; | ||
border: 2px solid $background; | ||
padding: 1%; | ||
} | ||
margin-bottom: 4%; | ||
margin-top: 5%; | ||
} | ||
.social { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
.submit-btn { | ||
background: $blue; | ||
margin-top: 30px; | ||
} | ||
.login { | ||
display: flex; | ||
align-items: center; | ||
margin-top: 10%; | ||
&-text { | ||
margin: -14px 5px 0 5px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$box-shadow: 1px 0px 4px rgba(0, 0, 0, 0.5); | ||
$background: #cecece; | ||
$blue: #3472d6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, { Component } from 'react'; | ||
import { Form, Button, Spinner } from 'react-bootstrap'; | ||
import { Link } from 'react-router-dom'; | ||
import '../../assets/styles/signup.scss'; | ||
|
||
class SignupForm extends Component { | ||
render() { | ||
const { onSubmit, onChange, error, handleConfirmPassword, isLoading } = this.props; | ||
return ( | ||
<div className="signup-page"> | ||
<h1>Authors Haven</h1> | ||
<div className="signup-form" id="form"> | ||
<Form onSubmit={onSubmit}> | ||
<Form.Group> | ||
<Form.Label>Email</Form.Label> | ||
<Form.Control | ||
isInvalid={error.errors && error.errors.email && error.errors.email[0]} | ||
type="email" | ||
placeholder="Enter email" | ||
id="email" | ||
name="email" | ||
onChange={onChange} | ||
required | ||
/> | ||
<Form.Control.Feedback type="invalid"> | ||
{error.errors && error.errors.email && error.errors.email[0]} | ||
</Form.Control.Feedback> | ||
</Form.Group> | ||
|
||
<Form.Group> | ||
<Form.Label>Username</Form.Label> | ||
<Form.Control | ||
isInvalid={error.errors && error.errors.username && error.errors.username[0]} | ||
placeholder="Enter username" | ||
name="username" | ||
id="username" | ||
onChange={onChange} | ||
required | ||
/> | ||
<Form.Control.Feedback id="username-error" type="invalid"> | ||
{error.errors && error.errors.username && error.errors.username[0]} | ||
</Form.Control.Feedback> | ||
</Form.Group> | ||
|
||
<Form.Group> | ||
<Form.Label>Password</Form.Label> | ||
<Form.Control | ||
isInvalid={error.errors && error.errors.password && error.errors.password[0]} | ||
type="password" | ||
placeholder="Enter password" | ||
name="password" | ||
id="password" | ||
onChange={onChange} | ||
required | ||
/> | ||
<Form.Control.Feedback type="invalid"> | ||
{error.errors && error.errors.password && error.errors.password[0]} | ||
</Form.Control.Feedback> | ||
</Form.Group> | ||
|
||
<Form.Group> | ||
<Form.Label>Confirm Password</Form.Label> | ||
<Form.Control | ||
type="password" | ||
placeholder="Confirm password" | ||
id="match" | ||
onChange={handleConfirmPassword} | ||
name="confirm_password" | ||
required | ||
/> | ||
</Form.Group> | ||
|
||
<div /> | ||
|
||
{!isLoading ? ( | ||
<Button className="submit-btn" id="btn" type="submit" block> | ||
Sign Up | ||
</Button> | ||
) : ( | ||
<Button id="spinner-loading" variant="primary" disabled block> | ||
<Spinner as="span" animation="border" size="sm" role="status" aria-hidden="true" /> | ||
Loading... | ||
</Button> | ||
)} | ||
</Form> | ||
<div> | ||
<div className="separator"> | ||
<div className="separator-line" /> | ||
<p className="separator-text">OR</p> | ||
<div className="separator-line" /> | ||
</div> | ||
<div className="login"> | ||
<p>Already have an account?</p> | ||
<Link className="login-text" to="/Login"> | ||
{' '} | ||
Login | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
SignupForm.propTypes = { | ||
onSubmit: PropTypes.func.isRequired, | ||
onChange: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default SignupForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import React, { Component } from 'react'; | ||
|
||
|
||
export class Home extends Component { | ||
|
||
render() { | ||
return ( | ||
<div> | ||
|
Oops, something went wrong.