Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions src/components/trade/components/global-modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const GlobalSettingsDialog = createLazyComponent(() => import("./global-settings
const SpotSwapModal = createLazyComponent(() => import("./spot-swap-modal"), "SpotSwapModal");
const CommandMenu = createLazyComponent(() => import("./command-menu"), "CommandMenu");
const PointsModal = createLazyComponent(() => import("../tradebox/points-modal"), "PointsModal");
const AcrossBridgeModal = createLazyComponent(() => import("../tradebox/across-bridge-modal"), "AcrossBridgeModal");

export function GlobalModals() {
return (
Expand All @@ -17,6 +18,7 @@ export function GlobalModals() {
<SpotSwapModal />
<CommandMenu />
<PointsModal />
<AcrossBridgeModal />
</Suspense>
);
}
17 changes: 14 additions & 3 deletions src/components/trade/header/top-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { t } from "@lingui/core/macro";
import { Trans } from "@lingui/react/macro";
import { DownloadSimpleIcon, DropIcon, GearIcon, TrophyIcon } from "@phosphor-icons/react";
import { ArrowsLeftRightIcon, DownloadSimpleIcon, DropIcon, GearIcon, TrophyIcon } from "@phosphor-icons/react";
import { useConnection } from "wagmi";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/cn";
import { useExchangeScope } from "@/providers/exchange-scope";
import {
useAcrossBridgeModalActions,
useDepositModalActions,
useFaucetModalActions,
usePointsModalActions,
Expand Down Expand Up @@ -35,6 +36,7 @@ export function TopNav() {
const { open: openFaucetModal } = useFaucetModalActions();
const { open: openPointsModal } = usePointsModalActions();
const { open: openSettingsDialog } = useSettingsDialogActions();
const { open: openAcrossBridge } = useAcrossBridgeModalActions();
const { isConnected } = useConnection();
const { scope } = useExchangeScope();

Expand Down Expand Up @@ -69,7 +71,7 @@ export function TopNav() {
<TrophyIcon className="size-4" />
<Trans>Points</Trans>
</Button>
{isTestnet ? (
{isTestnet && (
<Button
variant="outlined"
onClick={openFaucetModal}
Expand All @@ -78,7 +80,8 @@ export function TopNav() {
<DropIcon className="size-4" />
<Trans>Faucet</Trans>
</Button>
) : (
)}
{!isTestnet && (
<Button
variant="outlined"
onClick={() => openDepositModal("deposit")}
Expand All @@ -88,6 +91,14 @@ export function TopNav() {
<Trans>Deposit</Trans>
</Button>
)}
<Button
variant="outlined"
onClick={openAcrossBridge}
className="h-6 px-2 text-xs font-medium rounded-xs bg-fill-100 border border-border-300 text-text-950 hover:border-border-500 transition-colors inline-flex items-center gap-1 shadow-xs"
>
<ArrowsLeftRightIcon className="size-4" />
<Trans>Bridge</Trans>
</Button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The "Bridge" button is currently visible on testnet, but the AcrossBridgeModal is configured with mainnet chains (Ethereum, Arbitrum, Base) and a specific destination chain ID. It should likely be hidden when isTestnet is true, similar to the Deposit button, to prevent users from attempting to bridge funds in the wrong environment.

						{!isTestnet && (
							<Button
								variant="outlined"
								onClick={openAcrossBridge}
								className="h-6 px-2 text-xs font-medium rounded-xs bg-fill-100 border border-border-300 text-text-950 hover:border-border-500 transition-colors inline-flex items-center gap-1 shadow-xs"
							>
								<ArrowsLeftRightIcon className="size-4" />
								<Trans>Bridge</Trans>
							</Button>
						)}

</>
)}
<UserMenu />
Expand Down
Loading
Loading