Move wallet scrollIntoView into PortalOnboardingFlow

This commit is contained in:
Brandon Millman
2018-06-29 11:55:00 -07:00
parent f89acb49be
commit 03bc7bb935
2 changed files with 7 additions and 7 deletions

View File

@@ -47,8 +47,14 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp
public componentWillUnmount(): void {
this._unlisten();
}
public componentDidUpdate(): void {
public componentDidUpdate(prevProps: PortalOnboardingFlowProps): void {
this._overrideOnboardingStateIfShould();
if (!prevProps.isRunning && this.props.isRunning) {
// On mobile, make sure the wallet is completely visible.
if (this.props.screenWidth === ScreenWidths.Sm) {
document.querySelector('.wallet').scrollIntoView();
}
}
}
public render(): React.ReactNode {
return (