Move wallet scrollIntoView into PortalOnboardingFlow
This commit is contained in:
		@@ -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 (
 | 
			
		||||
 
 | 
			
		||||
@@ -154,12 +154,6 @@ export class Portal extends React.Component<PortalProps, PortalState> {
 | 
			
		||||
            // tslint:disable-next-line:no-floating-promises
 | 
			
		||||
            this._fetchBalancesAndAllowancesAsync(this._getCurrentTrackedTokensAddresses());
 | 
			
		||||
        }
 | 
			
		||||
        if (!prevProps.isPortalOnboardingShowing && this.props.isPortalOnboardingShowing) {
 | 
			
		||||
            // On mobile, make sure the wallet is completely visible.
 | 
			
		||||
            if (this.props.screenWidth === ScreenWidths.Sm) {
 | 
			
		||||
                document.querySelector('.wallet').scrollIntoView();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    public componentWillReceiveProps(nextProps: PortalProps): void {
 | 
			
		||||
        if (nextProps.networkId !== this.state.prevNetworkId) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user