aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-06 02:28:34 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-06 02:28:34 +0800
commite9e4df48912e22b22b2fc874cb64c5da63364772 (patch)
treec05de2495282c98de8629b720ad859c45350178b /packages
parente0f80c5e6aea48e83108d6c6cd481cdce26c9a4a (diff)
downloaddexon-sol-tools-e9e4df48912e22b22b2fc874cb64c5da63364772.tar
dexon-sol-tools-e9e4df48912e22b22b2fc874cb64c5da63364772.tar.gz
dexon-sol-tools-e9e4df48912e22b22b2fc874cb64c5da63364772.tar.bz2
dexon-sol-tools-e9e4df48912e22b22b2fc874cb64c5da63364772.tar.lz
dexon-sol-tools-e9e4df48912e22b22b2fc874cb64c5da63364772.tar.xz
dexon-sol-tools-e9e4df48912e22b22b2fc874cb64c5da63364772.tar.zst
dexon-sol-tools-e9e4df48912e22b22b2fc874cb64c5da63364772.zip
Fix onboarding closing on unlock metamask step on click outside
Diffstat (limited to 'packages')
-rw-r--r--packages/website/ts/components/onboarding/onboarding_flow.tsx4
-rw-r--r--packages/website/ts/components/onboarding/portal_onboarding_flow.tsx6
2 files changed, 8 insertions, 2 deletions
diff --git a/packages/website/ts/components/onboarding/onboarding_flow.tsx b/packages/website/ts/components/onboarding/onboarding_flow.tsx
index c2b4a4ca7..46dc897bd 100644
--- a/packages/website/ts/components/onboarding/onboarding_flow.tsx
+++ b/packages/website/ts/components/onboarding/onboarding_flow.tsx
@@ -44,12 +44,14 @@ export interface OnboardingFlowProps {
updateOnboardingStep: (stepIndex: number) => void;
disableOverlay?: boolean;
isMobile: boolean;
+ disableCloseOnClickOutside?: boolean;
}
export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
public static defaultProps = {
disableOverlay: false,
isMobile: false,
+ disableCloseOnClickOutside: false,
};
public render(): React.ReactNode {
if (!this.props.isRunning) {
@@ -86,7 +88,7 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
}
return (
<div>
- <Overlay onClick={this.props.onClose} />
+ <Overlay onClick={this.props.disableCloseOnClickOutside ? undefined : this.props.onClose} />
{onboardingElement}
</div>
);
diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
index 1c2c92fd1..fcfed82fa 100644
--- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
+++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
@@ -23,7 +23,7 @@ import {
WrapEthOnboardingStep3,
} from 'ts/components/onboarding/wrap_eth_onboarding_step';
import { AllowanceToggle } from 'ts/containers/inputs/allowance_toggle';
-import { ProviderType, ScreenWidths, Token, TokenByAddress, TokenStateByAddress } from 'ts/types';
+import { BrowserType, ProviderType, ScreenWidths, Token, TokenByAddress, TokenStateByAddress } from 'ts/types';
import { analytics } from 'ts/utils/analytics';
import { utils } from 'ts/utils/utils';
@@ -77,6 +77,10 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp
updateOnboardingStep={this._updateOnboardingStep.bind(this)}
disableOverlay={this.props.screenWidth === ScreenWidths.Sm}
isMobile={this.props.screenWidth === ScreenWidths.Sm}
+ // This is necessary to ensure onboarding stays open once the user unlocks metamask and clicks away
+ disableCloseOnClickOutside={
+ utils.getBrowserType() === BrowserType.Firefox && this.props.stepIndex === 1
+ }
/>
);
}