Ghost/ghost/members-auth-pages/index.js
Fabien O'Carroll 54560050c6 Updated auth-pages to use new members static url (#35)
refs https://github.com/TryGhost/Ghost/issues/10886

Since updating the static pages, the auth pages would be broken, this
updates them to correctly parse and load the static urls.
2019-07-09 15:49:05 +08:00

25 lines
581 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('/static/auth'));
this.state = {
apiUrl
};
}
render() {
return (
<MembersProvider apiUrl={ this.state.apiUrl }>
<Modal />
</MembersProvider>
);
}
}