Skip to content

Commit 7a1e4c1

Browse files
committed
[MNY-303] Various UI/UX Improvements in Bridge components
1 parent f6f138c commit 7a1e4c1

File tree

14 files changed

+353
-275
lines changed

14 files changed

+353
-275
lines changed

.changeset/wild-steaks-agree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
- Various UI/UX Improvements in Bridge components

packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export function TransactionPayment({
219219
}}
220220
>
221221
{/* USD Value */}
222-
<Text color="primaryText" size="xl" weight={600}>
222+
<Text color="primaryText" size="xl" weight={500}>
223223
{costToDisplay}
224224
</Text>
225225

packages/thirdweb/src/react/web/ui/Bridge/common/TokenAndChain.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function TokenAndChain({
8282
textOverflow: "ellipsis",
8383
whiteSpace: "nowrap",
8484
}}
85-
weight={600}
85+
weight={500}
8686
trackingTight
8787
>
8888
{token.name}

packages/thirdweb/src/react/web/ui/Bridge/common/TokenBalanceRow.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,9 @@ export function TokenBalanceRow({
6868
overflow: "hidden",
6969
}}
7070
>
71-
<FiatValue
72-
currency={currency}
73-
chain={chain}
74-
client={client}
71+
<Text
7572
color="primaryText"
7673
size="sm"
77-
token={token}
78-
tokenAmount={amount}
79-
/>
80-
<Text
81-
color="secondaryText"
82-
size="xs"
8374
style={{
8475
overflow: "hidden",
8576
textOverflow: "ellipsis",
@@ -91,6 +82,16 @@ export function TokenBalanceRow({
9182
minimumFractionDigits: 0,
9283
})} ${token.symbol}`}
9384
</Text>
85+
86+
<FiatValue
87+
currency={currency}
88+
chain={chain}
89+
client={client}
90+
color="secondaryText"
91+
size="sm"
92+
token={token}
93+
tokenAmount={amount}
94+
/>
9495
</Container>
9596
</Container>
9697
</StyledButton>

packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,23 @@ export function SelectedTokenButton(props: {
100100
}}
101101
>
102102
<Img
103-
src={props.chain?.icon}
103+
src={props.chain?.icon || ""}
104104
client={props.client}
105105
width={iconSize.sm}
106106
height={iconSize.sm}
107107
style={{
108108
borderRadius: radius.full,
109109
}}
110+
fallback={
111+
<Container
112+
style={{
113+
background: `linear-gradient(45deg, white, ${theme.colors.accentText})`,
114+
borderRadius: radius.full,
115+
width: `${iconSize.sm}px`,
116+
height: `${iconSize.sm}px`,
117+
}}
118+
/>
119+
}
110120
/>
111121
</Container>
112122
)}

packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function PaymentOverview(props: {
6363
<WalletRow
6464
address={sender}
6565
client={props.client}
66-
iconSize="md"
66+
iconSize="lg"
6767
textSize="sm"
6868
/>
6969
</Container>
@@ -91,13 +91,14 @@ export function PaymentOverview(props: {
9191
py="sm"
9292
style={{ justifyContent: "space-between" }}
9393
>
94+
{/* left */}
9495
<Container center="y" flex="row" gap="sm">
9596
{getFiatCurrencyIcon({
9697
currency: props.paymentMethod.currency,
9798
size: "lg",
9899
})}
99100
<Container center="y" flex="column" gap="3xs">
100-
<Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
101+
<Text color="primaryText" size="sm" weight={500}>
101102
{props.paymentMethod.currency}
102103
</Text>
103104
<Text color="secondaryText" size="xs">
@@ -106,7 +107,8 @@ export function PaymentOverview(props: {
106107
</Text>
107108
</Container>
108109
</Container>
109-
<Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
110+
{/* right */}
111+
<Text color="primaryText" size="sm">
110112
{props.fromAmount}
111113
</Text>
112114
</Container>
@@ -136,11 +138,12 @@ export function PaymentOverview(props: {
136138
<WalletRow
137139
address={props.receiver}
138140
client={props.client}
139-
iconSize="md"
141+
iconSize="lg"
140142
textSize="sm"
141143
/>
142144
</Container>
143145
)}
146+
144147
{props.modeInfo.mode === "direct_payment" && (
145148
<Container
146149
center="y"
@@ -150,7 +153,7 @@ export function PaymentOverview(props: {
150153
style={{ justifyContent: "space-between" }}
151154
>
152155
<Container center="y" flex="column" gap="3xs" style={{ flex: 1 }}>
153-
<Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
156+
<Text color="primaryText" size="sm" weight={500}>
154157
{props.metadata.title || "Payment"}
155158
</Text>
156159
{props.metadata.description && (
@@ -173,7 +176,6 @@ export function PaymentOverview(props: {
173176
size="sm"
174177
token={props.toToken}
175178
tokenAmount={props.modeInfo.paymentInfo.amount}
176-
weight={600}
177179
/>
178180
<Text color="secondaryText" size="xs">
179181
{props.modeInfo.paymentInfo.amount} {props.toToken.symbol}
@@ -285,7 +287,7 @@ const TransactionOverViewCompact = (props: {
285287
style={{ justifyContent: "space-between" }}
286288
>
287289
<Container center="y" flex="column" gap="3xs" style={{ flex: 1 }}>
288-
<Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
290+
<Text color="primaryText" size="sm" weight={500}>
289291
{props.metadata.title || "Transaction"}
290292
</Text>
291293
{props.metadata.description && (

packages/thirdweb/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function PaymentMethodTokenRow({
8989
<Text
9090
color="primaryText"
9191
size="sm"
92-
style={{ fontWeight: 600, textWrap: "nowrap" }}
92+
style={{ fontWeight: 500, textWrap: "nowrap" }}
9393
>
9494
{formatCurrencyAmount(
9595
currency || "USD",

0 commit comments

Comments
 (0)