import React from 'react'; import ReactDOM from 'react-dom'; import {createStore} from 'redux'; import {Map} from 'immutable'; class PixelatedComponent extends React.Component { _updateStateFromStore() { this.setState(this.props.store.getState().toJS()); } componentWillMount() { console.debug('mounting', this); this.unsubscribe = this.props.store.subscribe(() => this._updateStateFromStore()); this._updateStateFromStore(); } componentWillUnmount() { console.debug('unmounting', this); this.unsubscribe() } } class InviteCodeForm extends PixelatedComponent { render() { return (
); } _handleClick(event) { event.stopPropagation(); event.preventDefault(); this.props.store.dispatch({type: 'SUBMIT_INVITE_CODE'}); } } class CreateAccountForm extends PixelatedComponent { render() { return ( ); } _handleClick(event) { event.stopPropagation(); event.preventDefault(); this.props.store.dispatch({type: 'SUBMIT_CREATE_ACCOUNT'}); } } class BackupEmailForm extends PixelatedComponent { render() { return ( ); } _handleClick(event) { event.stopPropagation(); event.preventDefault(); this.props.store.dispatch({type: 'SUBMIT_CREATE_ACCOUNT'}); } } class SignUp extends PixelatedComponent { render() { return ({this.state.summary}