Skip to content

Commit ff2e53e

Browse files
committed
update
1 parent 04971a1 commit ff2e53e

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ export function FundWallet({
164164
return (
165165
<WithHeader
166166
client={client}
167-
title={metadata.title || `Buy ${destinationToken.symbol}`}
167+
title={
168+
metadata.title === undefined
169+
? `Buy ${destinationToken.symbol}`
170+
: metadata.title
171+
}
168172
description={metadata.description}
169173
image={metadata.image}
170174
>

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

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,24 @@ import { Container } from "../../components/basic.js";
66
import { Spacer } from "../../components/Spacer.js";
77
import { Text } from "../../components/text.js";
88

9-
export function WithHeader({
10-
children,
11-
title,
12-
description,
13-
image,
14-
client,
15-
}: {
9+
export function WithHeader(props: {
1610
children: React.ReactNode;
1711
title: string;
1812
description: string | undefined;
1913
image: string | undefined;
2014
client: ThirdwebClient;
2115
}) {
2216
const theme = useCustomTheme();
23-
const showTitle = title !== "";
2417

2518
return (
2619
<Container flex="column">
2720
{/* image */}
28-
{image && (
21+
{props.image && (
2922
<div
3023
style={{
3124
aspectRatio: "16/9",
3225
backgroundColor: theme.colors.tertiaryBg,
33-
backgroundImage: `url(${getUrl(client, image)})`,
26+
backgroundImage: `url(${getUrl(props.client, props.image)})`,
3427
backgroundPosition: "center",
3528
backgroundSize: "cover",
3629
borderRadius: `${radius.md} ${radius.md} 0 0`,
@@ -43,21 +36,21 @@ export function WithHeader({
4336
<Container flex="column" px="md">
4437
<Spacer y="md+" />
4538

46-
{(showTitle || description) && (
39+
{(props.title || props.description) && (
4740
<>
4841
{/* title */}
49-
{showTitle && (
42+
{props.title && (
5043
<Text color="primaryText" size="lg" weight={600}>
51-
{title}
44+
{props.title}
5245
</Text>
5346
)}
5447

5548
{/* Description */}
56-
{description && (
49+
{props.description && (
5750
<>
5851
<Spacer y="xxs" />
5952
<Text color="secondaryText" size="sm" multiline>
60-
{description}
53+
{props.description}
6154
</Text>
6255
</>
6356
)}
@@ -66,7 +59,7 @@ export function WithHeader({
6659
</>
6760
)}
6861

69-
{children}
62+
{props.children}
7063
</Container>
7164
</Container>
7265
);

0 commit comments

Comments
 (0)