Clicking overlay closes onboarding
This commit is contained in:
@@ -10,7 +10,7 @@ export const AddEthOnboardingStep: React.StatelessComponent<AddEthOnboardingStep
|
||||
<Container marginTop="15px" marginBottom="15px">
|
||||
<img src="/images/ether_alt.svg" height="50px" width="50px" />
|
||||
</Container>
|
||||
<Text>
|
||||
<Text className="xs-hide">
|
||||
Click on the <img src="/images/metamask_icon.png" height="20px" width="20px" /> metamask extension in your
|
||||
browser and click either <b>BUY</b> or <b>DEPOSIT</b>.
|
||||
</Text>
|
||||
|
||||
@@ -10,6 +10,6 @@ export const CongratsOnboardingStep: React.StatelessComponent<CongratsOnboarding
|
||||
<Container marginTop="25px" marginBottom="15px" className="flex justify-center">
|
||||
<img src="/images/zrx_ecosystem.svg" height="150px" />
|
||||
</Container>
|
||||
<Text>No need to log in. Each relayer automatically detects and connects to your metamask wallet.</Text>
|
||||
<Text>No need to log in. Each relayer automatically detects and connects to your wallet.</Text>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Placement, Popper, PopperChildrenProps } from 'react-popper';
|
||||
|
||||
import { OnboardingCard } from 'ts/components/onboarding/onboarding_card';
|
||||
import { ContinueButtonDisplay, OnboardingTooltip } from 'ts/components/onboarding/onboarding_tooltip';
|
||||
import { zIndex } from 'ts/style/z_index';
|
||||
import { Animation } from 'ts/components/ui/animation';
|
||||
import { Container } from 'ts/components/ui/container';
|
||||
import { Overlay } from 'ts/components/ui/overlay';
|
||||
@@ -54,14 +55,20 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
|
||||
if (this.props.disableOverlay) {
|
||||
return onboardingElement;
|
||||
}
|
||||
return <Overlay>{onboardingElement}</Overlay>;
|
||||
return (
|
||||
<div>
|
||||
<Overlay onClick={this.props.onClose} />
|
||||
{onboardingElement}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
private _getElementForStep(): Element {
|
||||
return document.querySelector(this._getCurrentStep().target);
|
||||
}
|
||||
private _renderPopperChildren(props: PopperChildrenProps): React.ReactNode {
|
||||
const customStyles = { zIndex: zIndex.aboveOverlay };
|
||||
return (
|
||||
<div ref={props.ref} style={props.style} data-placement={props.placement}>
|
||||
<div ref={props.ref} style={{ ...props.style, ...customStyles }} data-placement={props.placement}>
|
||||
{this._renderToolTip()}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as React from 'react';
|
||||
import { zIndex } from 'ts/style/z_index';
|
||||
|
||||
export interface OverlayProps {
|
||||
children?: React.ReactNode;
|
||||
style?: React.CSSProperties;
|
||||
onClick?: () => void;
|
||||
}
|
||||
@@ -19,7 +18,7 @@ const style: React.CSSProperties = {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.6)',
|
||||
};
|
||||
|
||||
export const Overlay: React.StatelessComponent = (props: OverlayProps) => (
|
||||
export const Overlay: React.StatelessComponent<OverlayProps> = props => (
|
||||
<div style={{ ...style, ...props.style }} onClick={props.onClick}>
|
||||
{props.children}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user