fix(onboarding): Don't allow going back into N1 signin

This commit is contained in:
Ben Gotow 2016-06-08 13:47:53 -07:00
parent 45dfcc1a6c
commit 7d52bb0d3c
2 changed files with 15 additions and 4 deletions

View file

@ -66,7 +66,10 @@ export default class OnboardingRoot extends React.Component {
return (
<div className="page-frame">
<PageTopBar pageDepth={this.state.pageDepth} />
<PageTopBar
pageDepth={this.state.pageDepth}
allowMoveBack={this.state.page !== 'account-choose'}
/>
<ReactCSSTransitionGroup
transitionName="alpha-fade"
transitionLeaveTimeout={150}

View file

@ -23,6 +23,15 @@ const PageTopBar = (props) => {
}
}
let backButton = (
<div className={closeClass} onClick={closeAction}>
<RetinaImg name={closeIcon} mode={RetinaImg.Mode.ContentPreserve} />
</div>
)
if (props.pageDepth > 1 && !props.allowMoveBack) {
backButton = null;
}
return (
<div
className="dragRegion"
@ -36,15 +45,14 @@ const PageTopBar = (props) => {
WebkitAppRegion: "drag",
}}
>
<div className={closeClass} onClick={closeAction}>
<RetinaImg name={closeIcon} mode={RetinaImg.Mode.ContentPreserve} />
</div>
{backButton}
</div>
)
}
PageTopBar.propTypes = {
pageDepth: React.PropTypes.number,
allowMoveBack: React.PropTypes.bool,
};
export default PageTopBar;