Ghost/ghost/members-api/static/auth/index.js
Fabien O'Carroll e1ba916ce6 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:35:17 +02:00

25 lines
585 B
JavaScript

import './styles/members.css';
import { Component } from 'preact';
import MembersProvider from './components/MembersProvider';
import Modal from './components/Modal';
export default class App extends Component {
constructor() {
super();
const apiUrl = window.location.href.substring(0, window.location.href.indexOf('/members/auth'));
this.state = {
apiUrl
};
}
render() {
return (
<MembersProvider apiUrl={ this.state.apiUrl }>
<Modal />
</MembersProvider>
);
}
}