Ghost/ghost/members-auth-pages/pages/SignupPage.js
Fabien O'Carroll b1a1f61d5d Refactored auth pages for future flows (#10458)
no-issue

* Used camelCase for gateway method calls
* Added some components for building blocks of forms
* Added input specific components
* Added Form component
    This handles collecting the data to submit and sharing state between forms
* Added Pages component to handle urls
* Added the pages for the popup
* Added MembersProvider component
    This is designed to give its children access to gateway methods
* Added Modal component
    This wraps the pages and handles dispatching form submissions to the members gateway
* Refactored index.js to use new components/pages
* Fixed default page from Signup -> Signin
2019-05-07 17:15:50 +02:00

27 lines
1.1 KiB
JavaScript

import Form from '../components/Form';
import FormHeader from '../components/FormHeader';
import FormHeaderCTA from '../components/FormHeaderCTA';
import FormSubmit from '../components/FormSubmit';
import NameInput from '../components/NameInput';
import EmailInput from '../components/EmailInput';
import PasswordInput from '../components/PasswordInput';
import { IconClose } from '../components/icons';
export default ({error, handleClose, handleSubmit}) => (
<div className="gm-modal-container">
<div className="gm-modal gm-auth-modal" onClick={(e) => e.stopPropagation()}>
<a className="gm-modal-close" onClick={handleClose}>{ IconClose }</a>
<FormHeader title="Sign up" error={error} errorText="Email already registered">
<FormHeaderCTA title="Already a member?" label="Log in" hash="#signin" />
</FormHeader>
<Form onSubmit={handleSubmit}>
<NameInput bindTo="name" />
<EmailInput bindTo="email" />
<PasswordInput bindTo="password" />
<FormSubmit label="Sign up" />
</Form>
</div>
</div>
);