-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/react-router-redux-integration' into dev
- Loading branch information
Showing
17 changed files
with
186 additions
and
98 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
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,9 @@ | ||
import { push } from 'react-router-redux'; | ||
import { setCookie } from './cookieActions'; | ||
|
||
export const redirect = (path) => { | ||
return (dispatch) => { | ||
dispatch(setCookie('redirect', path)); | ||
dispatch(push(path)); | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,16 +1,26 @@ | ||
import React from 'react'; | ||
import React, { PropTypes } from 'react'; | ||
import Grid from 'react-bootstrap/lib/Grid'; | ||
import Navigation from '../utils/Navigation'; | ||
import ErrorList from '../utils/ErrorList'; | ||
|
||
const PageLayout = ({ children, ...rest }) => ( | ||
let PageLayout = ({ hasGrid, children, ...rest }) => ( | ||
<div> | ||
<Navigation /> | ||
<ErrorList /> | ||
<Grid {...rest}> | ||
{children} | ||
</Grid> | ||
{hasGrid ? ( | ||
<Grid {...rest}> | ||
{children} | ||
</Grid> | ||
) : children} | ||
</div> | ||
); | ||
|
||
PageLayout.propTypes = { | ||
hasGrid: PropTypes.bool, | ||
}; | ||
|
||
PageLayout.defaultProps = { | ||
hasGrid: true, | ||
}; | ||
|
||
export default PageLayout; |
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 |
---|---|---|
@@ -1,42 +1,58 @@ | ||
import React from 'react'; | ||
import PageHeader from 'react-bootstrap/lib/PageHeader'; | ||
import Alert from 'react-bootstrap/lib/Alert'; | ||
import Grid from 'react-bootstrap/lib/Grid'; | ||
import Row from 'react-bootstrap/lib/Row'; | ||
import Col from 'react-bootstrap/lib/Col'; | ||
import PageLayout from '../../layouts/PageLayout'; | ||
import Head from '../../widgets/Head'; | ||
import LoginForm from '../../forms/LoginForm'; | ||
|
||
const LoginPage = (props) => ( | ||
<PageLayout> | ||
<Head | ||
links={[ | ||
'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/5.0.0/bootstrap-social.min.css', | ||
]} | ||
/> | ||
<PageHeader>Login</PageHeader> | ||
<Grid> | ||
<Row> | ||
<Col md={9}> | ||
<LoginForm location={props.location} /> | ||
</Col> | ||
<Col md={3}> | ||
<a | ||
href="/auth/facebook" | ||
className="btn btn-block btn-social btn-facebook" | ||
> | ||
<span className="fa fa-facebook"></span>Login with Facebook | ||
</a> | ||
<a | ||
href="/auth/linkedin" | ||
className="btn btn-block btn-social btn-linkedin" | ||
> | ||
<span className="fa fa-linkedin"></span>Login with LinkedIn | ||
</a> | ||
</Col> | ||
</Row> | ||
</Grid> | ||
</PageLayout> | ||
); | ||
let LoginPage = ({ location }) => { | ||
let { next } = location.query; | ||
let search = next ? '?next=' + next : ''; | ||
|
||
return ( | ||
<PageLayout hasGrid={false}> | ||
<Head | ||
links={[ | ||
'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/5.0.0/bootstrap-social.min.css', | ||
]} | ||
/> | ||
<Grid> | ||
<PageHeader>Login</PageHeader> | ||
<Row> | ||
<Col md={12}> | ||
{next && ( | ||
<Alert bsStyle="warning"> | ||
<strong>Authentication Required</strong> | ||
{' '}Please login first. | ||
</Alert> | ||
)} | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Col md={9}> | ||
<LoginForm /> | ||
</Col> | ||
<Col md={3}> | ||
<a | ||
href={`/auth/facebook${search}`} | ||
className="btn btn-block btn-social btn-facebook" | ||
> | ||
<span className="fa fa-facebook"></span>Login with Facebook | ||
</a> | ||
<a | ||
href={`/auth/linkedin${search}`} | ||
className="btn btn-block btn-social btn-linkedin" | ||
> | ||
<span className="fa fa-linkedin"></span>Login with LinkedIn | ||
</a> | ||
</Col> | ||
</Row> | ||
</Grid> | ||
</PageLayout> | ||
); | ||
}; | ||
|
||
export default LoginPage; |
Oops, something went wrong.