Skip to content

Commit 41371a8

Browse files
Clean up bridge page layout and sidebar UX
Add page header with eyebrow/title, replace oversized pill buttons with clean From/To chain panels and a single swap button, fix dead Ethereum connect link in alert, restructure sidebar header with proper wallet row and realm-card-title heading.
1 parent da619dd commit 41371a8

2 files changed

Lines changed: 33 additions & 41 deletions

File tree

apps/account-portal/src/components/modules/realms/bridge-sidebar.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,16 @@ const BridgeSidebar: React.FC<BridgeSidebarProps> = ({
136136
variant="inset"
137137
className="top-(--header-height) h-[calc(100svh-var(--header-height))]!"
138138
>
139-
<div className="flex items-center justify-end gap-2 text-sm">
140-
Ethereum Wallet:
141-
<EthereumConnect />
142-
</div>
143-
<SidebarSeparator className="mx-0 mt-2" />
144-
<SidebarHeader>
145-
<div className="border-b pb-2 text-xl">
139+
<SidebarHeader className="space-y-3">
140+
<div className="flex items-center justify-between">
141+
<span className="text-muted-foreground text-sm">Ethereum Wallet</span>
142+
<EthereumConnect />
143+
</div>
144+
<SidebarSeparator className="mx-0" />
145+
<h2 className="realm-card-title">
146146
Bridging {selectedRows.length} Realms to
147147
{selectedAsset === "Ethereum" ? " Starknet" : " Ethereum"}
148-
</div>
148+
</h2>
149149
<SidebarGroup>
150150
<div className="mb-4 flex flex-wrap gap-2">
151151
{selectedRows.map((row) => (
@@ -254,7 +254,7 @@ const BridgeSidebar: React.FC<BridgeSidebarProps> = ({
254254
asChild
255255
className="group/label text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground w-full text-sm"
256256
>
257-
<CollapsibleTrigger className="bg-sidebar-accent h-10">
257+
<CollapsibleTrigger className="h-10">
258258
Transaction History
259259
<ChevronRight className="ml-auto transition-transform group-data-[state=open]/collapsible:rotate-90" />
260260
</CollapsibleTrigger>

apps/account-portal/src/routes/realms.bridge.tsx

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { RowSelectionState } from "@tanstack/react-table";
22
import { Suspense, useEffect, useMemo, useState } from "react";
33
import EthereumIcon from "@/components/icons/ethereum.svg?react";
44
import StarknetIcon from "@/components/icons/starknet.svg?react";
5+
import { PageHeader } from "@/components/layout/page-header";
56
import BridgeSidebar from "@/components/modules/realms/bridge-sidebar";
67
import { BridgeTable, columns } from "@/components/modules/realms/bridge-table";
78
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
@@ -117,41 +118,39 @@ function RouteComponent() {
117118
className="flex flex-1"
118119
>
119120
<SidebarInset className="px-6">
120-
<div className="my-8 flex items-center justify-center space-x-4">
121-
<Button
122-
size="lg"
123-
className={`bg-primary/80 hover:bg-primary/80 cursor-default rounded-full`}
124-
>
125-
From:
121+
<PageHeader eyebrow="Realms" title="Starknet Bridge" className="mt-6" />
122+
<div className="mb-6 flex items-center justify-center gap-3">
123+
<div className="realm-subtle-panel flex items-center gap-2 rounded-lg px-4 py-2.5">
124+
<span className="text-muted-foreground text-sm">From</span>
126125
{selectedAsset === "Ethereum" ? (
127126
<>
128-
<EthereumIcon className="w-6! h-6!" />
129-
Ethereum
127+
<EthereumIcon className="h-5 w-5" />
128+
<span className="font-semibold">Ethereum</span>
130129
</>
131130
) : (
132131
<>
133-
<StarknetIcon className="w-6! h-6!" />
134-
Starknet
132+
<StarknetIcon className="h-5 w-5" />
133+
<span className="font-semibold">Starknet</span>
135134
</>
136135
)}
136+
</div>
137+
<Button size="icon" variant="outline" onClick={swapAssets} className="rounded-full">
138+
<ArrowLeftRight className="h-4 w-4" />
137139
</Button>
138-
<Button size="icon" onClick={swapAssets} className="rounded">
139-
<ArrowLeftRight className="h-7 w-7" />
140-
</Button>
141-
<Button size="lg" className="rounded-full" onClick={swapAssets}>
142-
To:
140+
<div className="realm-subtle-panel flex items-center gap-2 rounded-lg px-4 py-2.5">
141+
<span className="text-muted-foreground text-sm">To</span>
143142
{selectedAsset === "Ethereum" ? (
144143
<>
145-
<StarknetIcon className="w-6! h-6!" />
146-
Starknet
144+
<StarknetIcon className="h-5 w-5" />
145+
<span className="font-semibold">Starknet</span>
147146
</>
148147
) : (
149148
<>
150-
<EthereumIcon className="w-6! h-6!" />
151-
Ethereum
149+
<EthereumIcon className="h-5 w-5" />
150+
<span className="font-semibold">Ethereum</span>
152151
</>
153152
)}
154-
</Button>
153+
</div>
155154
</div>
156155
{selectedAsset === "Ethereum" && !l1Address && (
157156
<Alert className="mb-4 rounded border-warning">
@@ -160,14 +159,7 @@ function RouteComponent() {
160159
Your Ethereum wallet is not connected
161160
</AlertTitle>
162161
<AlertDescription>
163-
<Button
164-
className="pl-0 pr-2"
165-
variant={"link"}
166-
// onClick={openConnectModal}
167-
>
168-
Connect
169-
</Button>
170-
to view and bridge your Realms
162+
Connect your Ethereum wallet using the sidebar to view and bridge your Realms
171163
</AlertDescription>
172164
</Alert>
173165
)}
@@ -179,13 +171,13 @@ function RouteComponent() {
179171
</AlertTitle>
180172
<AlertDescription>
181173
<Button
182-
className="pl-0 pr-2"
183-
variant={"link"}
174+
className="h-auto p-0"
175+
variant="link"
184176
onClick={() => openStarknetKitModal()}
185177
>
186-
Connect
178+
Connect your Starknet wallet
187179
</Button>
188-
to view and bridge your Realms
180+
{" "}to view and bridge your Realms
189181
</AlertDescription>
190182
</Alert>
191183
)}

0 commit comments

Comments
 (0)