Skip to content

Commit b3fe76a

Browse files
committed
move token selection to modal
1 parent 9cf8688 commit b3fe76a

File tree

18 files changed

+141
-126
lines changed

18 files changed

+141
-126
lines changed

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/PayEmbedSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function BuyTokenEmbed(props: {
2323
const themeObj = getSDKTheme(theme === "light" ? "light" : "dark");
2424
return (
2525
<div className="bg-card rounded-2xl border overflow-hidden flex flex-col">
26-
<div className="flex gap-2 p-4 border-b border-dashed">
26+
<div className="flex gap-2.5 p-4 border-b border-dashed">
2727
<TabButton
2828
label="Swap"
2929
onClick={() => setTab("swap")}

packages/thirdweb/src/react/core/design-system/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export const spacing = {
177177
"4xs": "2px",
178178
lg: "24px",
179179
md: "16px",
180+
"md+": "20px",
180181
sm: "12px",
181182
xl: "32px",
182183
xs: "8px",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export function StepRunner({
249249
};
250250

251251
return (
252-
<Container flex="column" fullHeight p="md">
252+
<Container flex="column" fullHeight px="md" pb="md" pt="md+">
253253
<ModalHeader onBack={onBack} title={title || "Processing Payment"} />
254254

255255
<Spacer y="xl" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function WithHeader({
4040
)}
4141

4242
<Container flex="column" px="md">
43-
<Spacer y="md" />
43+
<Spacer y="md+" />
4444

4545
{(showTitle || uiOptions.metadata?.description) && (
4646
<>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ export function PaymentDetails({
266266
const displayData = getDisplayData();
267267

268268
return (
269-
<Container flex="column" fullHeight p="md">
269+
<Container flex="column" fullHeight px="md" pb="md" pt="md+">
270270
<ModalHeader onBack={onBack} title={title || "Payment Details"} />
271271

272272
<Spacer y="lg" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export function PaymentSelection({
280280
}
281281

282282
return (
283-
<Container flex="column" p="md">
283+
<Container flex="column" px="md" pb="md" pt="md+">
284284
<ModalHeader onBack={getBackHandler()} title={getStepTitle()} />
285285
<Spacer y="lg" />
286286

packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { trackPayEvent } from "../../../../../analytics/track/pay.js";
66
import type { ThirdwebClient } from "../../../../../client/client.js";
77
import type { WindowAdapter } from "../../../../core/adapters/WindowAdapter.js";
88
import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
9-
import { iconSize } from "../../../../core/design-system/index.js";
9+
import { iconSize, spacing } from "../../../../core/design-system/index.js";
1010
import type { BridgePrepareResult } from "../../../../core/hooks/useBridgePrepare.js";
1111
import type { CompletedStatusResult } from "../../../../core/hooks/useStepExecutor.js";
1212
import { Container, ModalHeader } from "../../components/basic.js";
@@ -91,10 +91,10 @@ export function SuccessScreen({
9191
}
9292

9393
return (
94-
<Container flex="column" fullHeight p="md">
94+
<Container flex="column" fullHeight px="md" pb="md" pt="md+">
9595
<ModalHeader title="Payment Complete" />
9696

97-
<Spacer y="xl" />
97+
<Spacer y="xxl" />
9898

9999
<Container center="x" flex="column" gap="md">
100100
{/* Success Icon with Animation */}
@@ -103,7 +103,6 @@ export function SuccessScreen({
103103
flex="row"
104104
style={{
105105
animation: "successBounce 0.6s ease-out",
106-
backgroundColor: theme.colors.tertiaryBg,
107106
border: `2px solid ${theme.colors.success}`,
108107
borderRadius: "50%",
109108
height: "64px",
@@ -121,19 +120,31 @@ export function SuccessScreen({
121120
/>
122121
</Container>
123122

124-
<Text center color="primaryText" size="xl" weight={600} trackingTight>
125-
Payment Successful!
126-
</Text>
127-
128-
<Text center color="secondaryText" size="sm">
129-
{hasPaymentId
130-
? "You can now close this page and return to the application."
131-
: uiOptions.mode === "transaction"
132-
? "Click continue to execute your transaction."
133-
: "Your payment has been completed successfully."}
134-
</Text>
123+
<div>
124+
<Text
125+
center
126+
color="primaryText"
127+
size="xl"
128+
weight={600}
129+
trackingTight
130+
style={{
131+
marginBottom: spacing.xxs,
132+
}}
133+
>
134+
Payment Successful!
135+
</Text>
136+
137+
<Text center color="secondaryText" size="sm">
138+
{hasPaymentId
139+
? "You can now close this page and return to the application."
140+
: uiOptions.mode === "transaction"
141+
? "Click continue to execute your transaction."
142+
: "Your payment has been completed successfully."}
143+
</Text>
144+
</div>
135145
</Container>
136-
<Spacer y="lg" />
146+
147+
<Spacer y="xxl" />
137148

138149
{/* Action Buttons */}
139150
<Container flex="column" gap="sm" style={{ width: "100%" }}>

packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ function SwapWidgetContent(props: SwapWidgetProps) {
346346
}
347347
return undefined;
348348
});
349+
349350
const [sellToken, setSellToken] = useState<TokenSelection | undefined>(() => {
350351
if (props.prefill?.sellToken) {
351352
return {

packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function SelectBridgeChainUI(
5151

5252
return (
5353
<div>
54-
<Container px="lg" py="md">
54+
<Container px="md" py="md+">
5555
<ModalHeader onBack={props.onBack} title="Select Chain" />
5656
</Container>
5757
<Line />

packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function SelectTokenUI(
182182
if (screen === "select-token") {
183183
return (
184184
<Container>
185-
<Container px="lg" py="md">
185+
<Container px="md" py="md+">
186186
<ModalHeader onBack={props.onBack} title="Select Token" />
187187
</Container>
188188
<Line />
@@ -193,7 +193,7 @@ function SelectTokenUI(
193193
display: "flex",
194194
alignItems: "center",
195195
justifyContent: "center",
196-
minHeight: "400px",
196+
height: "400px",
197197
}}
198198
>
199199
<Spinner color="secondaryText" size="xl" />
@@ -231,9 +231,9 @@ function SelectTokenUI(
231231
}}
232232
>
233233
{props.isFetching &&
234-
new Array(20).fill(0).map(() => (
235-
// biome-ignore lint/correctness/useJsxKeyInIterable: ok
236-
<TokenButtonSkeleton />
234+
new Array(20).fill(0).map((_, i) => (
235+
// biome-ignore lint/suspicious/noArrayIndexKey: ok
236+
<TokenButtonSkeleton key={i} />
237237
))}
238238

239239
{!props.isFetching && sortedOwnedTokens.length > 0 && (
@@ -267,8 +267,8 @@ function SelectTokenUI(
267267
client={props.client}
268268
onSelect={props.setSelectedToken}
269269
isSelected={
270-
props.selectedToken?.tokenAddress ===
271-
token.token_address
270+
props.selectedToken?.tokenAddress.toLowerCase() ===
271+
token.token_address.toLowerCase()
272272
}
273273
/>
274274
))}
@@ -307,7 +307,8 @@ function SelectTokenUI(
307307
client={props.client}
308308
onSelect={props.setSelectedToken}
309309
isSelected={
310-
props.selectedToken?.tokenAddress === token.address
310+
props.selectedToken?.tokenAddress.toLowerCase() ===
311+
token.address.toLowerCase()
311312
}
312313
/>
313314
))}

0 commit comments

Comments
 (0)