React = require 'react/addons' OnboardingActions = require './onboarding-actions' ReactCSSTransitionGroup = React.addons.CSSTransitionGroup PageRouterStore = require './page-router-store' LoginPage = require './login-page' ConnectAccountPage = require './connect-account-page' ExternalAuthWebviewPage = require './external-auth-webview-page' SuccessPage = require './success-page' class PageRouter extends React.Component @displayName: 'PageRouter' @containerRequired: false constructor: (@props) -> @state = @_getStateFromStore() window.OnboardingActions = OnboardingActions _getStateFromStore: => page: PageRouterStore.page() pageData: PageRouterStore.pageData() componentDidMount: => @unsubscribe = PageRouterStore.listen(@_onStateChanged, @) _onStateChanged: => @setState(@_getStateFromStore()) componentWillUnmount: => @unsubscribe?() render: =>