Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: QR code tooltip is not gone #258

Merged
merged 1 commit into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/godwoken-bridge/src/components/CustomTooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
import { Tooltip, TooltipProps } from "antd";

export const CustomTooltip: React.FC<TooltipProps> = (props) => {
return (
<Tooltip
// Set z-index lower than modal
zIndex={props.zIndex ?? 999}
{...props}
/>
);
};
21 changes: 11 additions & 10 deletions apps/godwoken-bridge/src/components/WalletInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useDotBitReverseAlias } from "../../hooks/useDotBit";
import { Placeholder } from "../Placeholder";
import { QrCodeModal } from "../QrCodeModal";
import { COLOR } from "../../style/variables";
import { CustomTooltip } from "../CustomTooltip";

const StyleWrapper = styled.div`
display: flex;
Expand Down Expand Up @@ -188,7 +189,7 @@ export const WalletInfo: React.FC<WalletInfoProps> = (props) => {
</div>

<div className="actions">
<Tooltip title="Check address details">
<CustomTooltip title="Check address details">
<ActionButton
className="button"
onClick={() => showQrCode("L1 Wallet Address", l1Address, getL1BrowserLink(l1Address))}
Expand All @@ -197,14 +198,14 @@ export const WalletInfo: React.FC<WalletInfoProps> = (props) => {
<MoreVertRound />
</Icon>
</ActionButton>
</Tooltip>
<Tooltip title="Copy address">
</CustomTooltip>
<CustomTooltip title="Copy address">
<ActionButton className="button" onClick={() => copyValue("L1 Wallet Address", l1Address)}>
<Icon>
<ContentCopyOutlined />
</Icon>
</ActionButton>
</Tooltip>
</CustomTooltip>
</div>
</div>

Expand All @@ -217,7 +218,7 @@ export const WalletInfo: React.FC<WalletInfoProps> = (props) => {
</div>

<div className="actions">
<Tooltip title="Check address details">
<CustomTooltip title="Check address details">
<ActionButton
className="button"
onClick={() => showQrCode("L1 Deposit Address", depositAddress, getL1BrowserLink(depositAddress))}
Expand All @@ -226,14 +227,14 @@ export const WalletInfo: React.FC<WalletInfoProps> = (props) => {
<MoreVertRound />
</Icon>
</ActionButton>
</Tooltip>
<Tooltip title="Copy address">
</CustomTooltip>
<CustomTooltip title="Copy address">
<ActionButton className="button" onClick={() => copyValue("L1 Deposit Address", depositAddress)}>
<Icon>
<ContentCopyOutlined />
</Icon>
</ActionButton>
</Tooltip>
</CustomTooltip>
</div>
</div>

Expand All @@ -244,7 +245,7 @@ export const WalletInfo: React.FC<WalletInfoProps> = (props) => {
</div>

<div className="actions">
<Tooltip title="Check address details">
<CustomTooltip title="Check address details">
<ActionButton
className="button"
onClick={() => showQrCode("Ethereum Address", ethAddress, getL2BrowserLink(ethAddress))}
Expand All @@ -253,7 +254,7 @@ export const WalletInfo: React.FC<WalletInfoProps> = (props) => {
<MoreVertRound />
</Icon>
</ActionButton>
</Tooltip>
</CustomTooltip>
<Tooltip title="Copy address">
<ActionButton className="button" onClick={() => copyValue("Ethereum Address", ethAddress)}>
<Icon>
Expand Down