src/components/LoginPage.jsx
import React from 'react';
import { connect } from 'react-redux';
import { startLogin } from '../actions/auth';
export const LoginPage = ({ startLogin }) => (
<div className="box-layout">
<div className="box-layout__box">
<h1 className="box-layout__title">Blogstoph Login</h1>
<p>Log in to edit your posts.</p>
<button className="button" onClick={startLogin}>Login with Google</button>
</div>
</div>
);
const mapDispatchToProps = (dispatch) => ({
startLogin: () => dispatch(startLogin('google'))
});
export default connect(undefined, mapDispatchToProps)(LoginPage);