Skip to content

Commit

Permalink
built the details component for quicklinks
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxnelson997 committed Jul 10, 2018
1 parent 7c69d70 commit f646474
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/components/auth/signinForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,30 @@ import React, { Component } from 'react';
import { reduxForm, Field } from 'redux-form';

import { FormInput, FormButton } from '../formFields';
import Details from '../details';

import history from '../../history';

class SignInForm extends Component {
render() {
const { className, handleSubmit } = this.props;
const links = [
{
_id: 0,
title: 'Not registered? Create account here',
onClick: () => history.push('/signup')
},
{
_id: 1,
title: 'Forgot account email?',
onClick: () => console.log('forgot email')
},
{
_id: 2,
title: 'Forgot password?',
onClick: () => console.log('forgot password')
}
]
return (
<form onSubmit={handleSubmit} className={`${className} sign-in-form`}>
<Field className='sign-in-form__email'
Expand All @@ -28,6 +48,7 @@ class SignInForm extends Component {
title='Login'
name='login'
component={FormButton}/>
<Details className='sign-in-form__details' title='QuickLinks' links={links}/>
</form>
)
}
Expand Down
21 changes: 21 additions & 0 deletions src/components/details.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React, { Component } from 'react';

class Details extends Component {
render() {
const { title, links } = this.props;
return (
<div className='details'>
<div className='details__title'>{title}</div>
<div className='details__links'>
{
links.map(link => {
return <a key={link._id} onClick={link.onClick} className='details__link'>{link.title}</a>
})
}
</div>
</div>
)
}
}

export default Details;

0 comments on commit f646474

Please sign in to comment.