Only elevate wallet zIndex when onboarding is in progress
This commit is contained in:
@@ -33,6 +33,7 @@ import { localStorage } from 'ts/local_storage/local_storage';
|
||||
import { trackedTokenStorage } from 'ts/local_storage/tracked_token_storage';
|
||||
import { FullscreenMessage } from 'ts/pages/fullscreen_message';
|
||||
import { Dispatcher } from 'ts/redux/dispatcher';
|
||||
import { zIndex } from 'ts/style/z_index';
|
||||
import {
|
||||
BlockchainErrs,
|
||||
HashData,
|
||||
@@ -73,6 +74,7 @@ export interface PortalProps {
|
||||
flashMessage?: string | React.ReactNode;
|
||||
lastForceTokenStateRefetch: number;
|
||||
translate: Translate;
|
||||
isPortalOnboardingShowing: boolean;
|
||||
}
|
||||
|
||||
interface PortalState {
|
||||
@@ -335,6 +337,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
|
||||
return (
|
||||
<div>
|
||||
<Wallet
|
||||
style={this.props.isPortalOnboardingShowing ? { zIndex: zIndex.aboveOverlay } : undefined}
|
||||
userAddress={this.props.userAddress}
|
||||
networkId={this.props.networkId}
|
||||
blockchain={this._blockchain}
|
||||
|
||||
@@ -23,7 +23,6 @@ import { WrapEtherItem } from 'ts/components/wallet/wrap_ether_item';
|
||||
import { AllowanceToggle } from 'ts/containers/inputs/allowance_toggle';
|
||||
import { Dispatcher } from 'ts/redux/dispatcher';
|
||||
import { colors } from 'ts/style/colors';
|
||||
import { zIndex } from 'ts/style/z_index';
|
||||
import {
|
||||
BlockchainErrs,
|
||||
ProviderType,
|
||||
@@ -59,6 +58,7 @@ export interface WalletProps {
|
||||
onAddToken: () => void;
|
||||
onRemoveToken: () => void;
|
||||
refetchTokenStateAsync: (tokenAddress: string) => Promise<void>;
|
||||
style: React.CSSProperties;
|
||||
}
|
||||
|
||||
interface WalletState {
|
||||
@@ -79,7 +79,6 @@ interface AccessoryItemConfig {
|
||||
const styles: Styles = {
|
||||
root: {
|
||||
width: '100%',
|
||||
zIndex: zIndex.aboveOverlay,
|
||||
position: 'relative',
|
||||
},
|
||||
footerItemInnerDiv: {
|
||||
@@ -134,6 +133,9 @@ const NO_ALLOWANCE_TOGGLE_SPACE_WIDTH = 56;
|
||||
const ACCOUNT_PATH = `${WebsitePaths.Portal}/account`;
|
||||
|
||||
export class Wallet extends React.Component<WalletProps, WalletState> {
|
||||
public static defaultProps = {
|
||||
style: {},
|
||||
};
|
||||
constructor(props: WalletProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@@ -141,11 +143,10 @@ export class Wallet extends React.Component<WalletProps, WalletState> {
|
||||
isHoveringSidebar: false,
|
||||
};
|
||||
}
|
||||
|
||||
public render(): React.ReactNode {
|
||||
const isBlockchainLoaded = this.props.blockchainIsLoaded && this.props.blockchainErr === BlockchainErrs.NoError;
|
||||
return (
|
||||
<Island className="flex flex-column wallet" style={styles.root}>
|
||||
<Island className="flex flex-column wallet" style={{ ...styles.root, ...this.props.style }}>
|
||||
{isBlockchainLoaded ? this._renderLoadedRows() : this._renderLoadingRows()}
|
||||
</Island>
|
||||
);
|
||||
|
||||
@@ -28,6 +28,7 @@ interface ConnectedState {
|
||||
userSuppliedOrderCache: Order;
|
||||
flashMessage?: string | React.ReactNode;
|
||||
translate: Translate;
|
||||
isPortalOnboardingShowing: boolean;
|
||||
}
|
||||
|
||||
interface ConnectedDispatch {
|
||||
@@ -76,6 +77,7 @@ const mapStateToProps = (state: State, _ownProps: PortalComponentProps): Connect
|
||||
userSuppliedOrderCache: state.userSuppliedOrderCache,
|
||||
flashMessage: state.flashMessage,
|
||||
translate: state.translate,
|
||||
isPortalOnboardingShowing: state.isPortalOnboardingShowing,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user