-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
254 additions
and
33 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,29 +1,20 @@ | ||
import React, { PureComponent } from 'react'; | ||
import { | ||
Card, | ||
} from 'reactstrap'; | ||
import React from 'react'; | ||
import { Card as ReactStrapCard } from 'reactstrap'; | ||
import propTypes from 'prop-types'; | ||
import './card.scss'; | ||
|
||
class CardComponent extends PureComponent { | ||
render() { | ||
const { | ||
children, cardStyle, | ||
} = this.props; | ||
return ( | ||
<Card className={cardStyle}> | ||
{children} | ||
</Card> | ||
); | ||
} | ||
} | ||
const Card = ({ children, cardStyle }) => ( | ||
<ReactStrapCard className={cardStyle}> | ||
{children} | ||
</ReactStrapCard> | ||
); | ||
|
||
CardComponent.propTypes = { | ||
Card.propTypes = { | ||
children: propTypes.element, | ||
cardStyle: propTypes.string, | ||
}; | ||
CardComponent.defaultProps = { | ||
cardStyle: '', | ||
}; | ||
|
||
export default CardComponent; | ||
Card.defaultProps = { | ||
cardStyle: 'c-card', | ||
}; | ||
export default Card; |
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
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,70 @@ | ||
import React, { PureComponent } from 'react'; | ||
import queryString from 'query-string'; | ||
import { connect } from 'react-redux'; | ||
import { withRouter } from 'react-router-dom'; | ||
import { CardBody, CardText } from 'reactstrap'; | ||
import propTypes from 'prop-types'; | ||
import Card from '../Card/Card'; | ||
import { Header } from '../Header/Header'; | ||
import Footer from '../Footer/Footer'; | ||
import * as actions from '../../../store/actions/authActions'; | ||
import { Heading } from '../Heading/Heading'; | ||
import './VerifyUser.scss'; | ||
|
||
export class VerifyUser extends PureComponent { | ||
state = { | ||
verify: 'verifying, ...', | ||
}; | ||
|
||
componentDidMount() { | ||
const verifyUsers = async () => { | ||
const { verifyAuth, history, location } = this.props; | ||
const { token } = queryString.parse(location.search); | ||
|
||
await verifyAuth(token, history); | ||
const { verified } = this.props; | ||
this.setState({ | ||
verify: verified, | ||
}); | ||
}; | ||
|
||
verifyUsers(); | ||
} | ||
|
||
render() { | ||
const { verify } = this.state; | ||
const top = verify.split(',')[0]; | ||
const buttom = verify.split(',')[1]; | ||
return ( | ||
<div className="containers"> | ||
<div className="bg-image" /> | ||
<Header /> | ||
<Card> | ||
<CardBody className="verified"> | ||
<Heading title={top} /> | ||
<CardText>{buttom}</CardText> | ||
</CardBody> | ||
</Card> | ||
<Footer /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = state => ({ | ||
verified: state.auth.verified, | ||
loading: state.auth.isLoading, | ||
}); | ||
|
||
const mapDispatchToProps = { | ||
verifyAuth: actions.verifyAuthUser, | ||
}; | ||
|
||
VerifyUser.propTypes = { | ||
history: propTypes.shape({ push: propTypes.func }), | ||
verifyAuth: propTypes.func, | ||
location: propTypes.shape({ search: propTypes.string }), | ||
verified: propTypes.string, | ||
}; | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(withRouter(VerifyUser)); |
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,48 @@ | ||
$error-color: #ff0000; | ||
$bg-color: #ffffff; | ||
$text-color: #ccc; | ||
$form-color: #f3994a; | ||
$success-color: #008000; | ||
|
||
.containers { | ||
align-content: center; | ||
display: flex; | ||
flex-direction: column; | ||
height: calc(100vh); | ||
justify-content: center; | ||
padding: 0; | ||
width: 100%; | ||
z-index: 1000; | ||
|
||
.verified { | ||
padding: 3rem; | ||
height: 140px; | ||
} | ||
|
||
@media screen and (min-width: 1200px) { | ||
max-width: 2140px; | ||
padding: 0; | ||
} | ||
|
||
.bg-image { | ||
background: url("../../assets/images/background.jpg") center center no-repeat; | ||
background-size: cover; | ||
display: block; | ||
-webkit-filter: blur(5px); | ||
-moz-filter: blur(5px); | ||
-o-filter: blur(5px); | ||
-ms-filter: blur(5px); | ||
filter: blur(5px); | ||
height: 100%; | ||
left: 0; | ||
position: fixed; | ||
right: 0; | ||
z-index: -1000; | ||
} | ||
|
||
.card-text { | ||
color: $text-color; | ||
margin-bottom: 20px; | ||
text-align: center; | ||
} | ||
} |
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
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`test verify user component should test verify 1`] = `ShallowWrapper {}`; |
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,19 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { VerifyUser } from '../../components/VerifyUser/VerifyUser'; | ||
import store from '../../../store'; | ||
|
||
describe('test verify user component', () => { | ||
const prop = { | ||
verifyAuth: () => {}, | ||
location: { | ||
search: '', | ||
}, | ||
verified: 'hello, mobolaji', | ||
}; | ||
const verify = shallow(<VerifyUser {...prop} store={store} />); | ||
|
||
it('should test verify', () => { | ||
expect(verify).toMatchSnapshot(); | ||
}); | ||
}); |
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,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`test verify user page should test verify user page 1`] = `ShallowWrapper {}`; |
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,11 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import VerifyUser from '../../views/VerifyUser/verifyUser'; | ||
|
||
describe('test verify user page', () => { | ||
const verify = shallow(<VerifyUser />); | ||
|
||
it('should test verify user page', () => { | ||
expect(verify).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.