Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/free-pandas-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Add thirdweb branding to PayEmbed
2 changes: 1 addition & 1 deletion packages/thirdweb/src/exports/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export type {
PaymentInfo,
DirectPaymentOptions,
FundWalletOptions,
TranasctionOptions,
TransactionOptions,
} from "../react/core/hooks/connection/ConnectButtonProps.js";

export {
Expand Down
2 changes: 1 addition & 1 deletion packages/thirdweb/src/insight/get-nfts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ async function transformNFTModel(
client: client,
}),
id: BigInt(token_id),
});
}).catch(() => 0n);

parsedNft = parseNFT(metadata, {
tokenId: BigInt(token_id),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,14 @@ export type PayUIOptions = Prettify<
name?: string;
image?: string;
};
} & (FundWalletOptions | DirectPaymentOptions | TranasctionOptions)

/**
* Show the "Powered by Thirdweb" branding at the bottom of the PayEmbed UI.
*
* By default it is `true`.
*/
showThirdwebBranding?: boolean;
} & (FundWalletOptions | DirectPaymentOptions | TransactionOptions)
>;

export type FundWalletOptions = {
Expand Down Expand Up @@ -168,7 +175,7 @@ export type DirectPaymentOptions = {
paymentInfo: PaymentInfo;
};

export type TranasctionOptions = {
export type TransactionOptions = {
mode: "transaction";
/**
* The transaction to be executed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export type SendTransactionPayModalConfig =
transactionHash: Hex;
},
) => void;
showThirdwebBranding?: boolean;
}
| false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
transaction: data.tx,
metadata: payModal?.metadata,
onPurchaseSuccess: payModal?.onPurchaseSuccess,
showThirdwebBranding: payModal?.showThirdwebBranding,

Check warning on line 130 in packages/thirdweb/src/react/web/hooks/transaction/useSendTransaction.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/hooks/transaction/useSendTransaction.tsx#L130

Added line #L130 was not covered by tests
}}
/>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
/**
* @internal
*/
export function PoweredByThirdweb() {
export function PoweredByThirdweb(props: {
link?: string;
}) {
const link =
props.link ||
"https://playground.thirdweb.com/connect/sign-in/button?utm_source=cw_text";

Check warning on line 14 in packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx#L11-L14

Added lines #L11 - L14 were not covered by tests
return (
<Link
color="secondaryText"
hoverColor="primaryText"
target="_blank"
href="https://thirdweb.com/connect?utm_source=cw_text"
href={link}

Check warning on line 20 in packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx#L20

Added line #L20 was not covered by tests
>
<Container
flex="row"
Expand All @@ -23,15 +28,15 @@
}}
>
<Text
size="sm"
size="xs"

Check warning on line 31 in packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx#L31

Added line #L31 was not covered by tests
weight={600}
style={{
color: "currentColor",
}}
>
Powered by
</Text>
<ThirdwebTextIcon height={13} />
<ThirdwebTextIcon height={11} />

Check warning on line 39 in packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx#L39

Added line #L39 was not covered by tests
</Container>
</Link>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import { TokenSymbol } from "../../../components/token/TokenSymbol.js";
import { ConnectButton } from "../../ConnectButton.js";
import { ChainButton, NetworkSelectorContent } from "../../NetworkSelector.js";
import { PoweredByThirdweb } from "../../PoweredByTW.js";
import type { ConnectLocale } from "../../locale/types.js";
import { TokenSelector } from "../TokenSelector.js";
import { WalletSwitcherConnectionScreen } from "../WalletSwitcherConnectionScreen.js";
Expand Down Expand Up @@ -833,7 +834,8 @@
}
default: {
return (
<Container p="lg">
<Container px="lg">
<Spacer y="lg" />

Check warning on line 838 in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx#L837-L838

Added lines #L837 - L838 were not covered by tests
<ModalHeader title={props.title} onBack={props.onBack} />

<Spacer y="xl" />
Expand Down Expand Up @@ -899,6 +901,13 @@
</Button>
)}
</Container>
<Spacer y="lg" />
{payOptions.showThirdwebBranding !== false && (
<>
<PoweredByThirdweb link="https://playground.thirdweb.com/connect/pay?utm_source=ub_text" />
<Spacer y="sm" />
</>

Check warning on line 909 in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx#L904-L909

Added lines #L904 - L909 were not covered by tests
)}
</Container>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import { Button } from "../../../components/buttons.js";
import { Text } from "../../../components/text.js";
import { ConnectButton } from "../../ConnectButton.js";
import { PoweredByThirdweb } from "../../PoweredByTW.js";
import { type ERC20OrNativeToken, isNativeToken } from "../nativeToken.js";
import type { SupportedChainAndTokens } from "./swap/useSwapSupportedChains.js";

Expand Down Expand Up @@ -108,7 +109,8 @@
};

return (
<Container p="lg">
<Container px="lg">
<Spacer y="lg" />

Check warning on line 113 in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx#L112-L113

Added lines #L112 - L113 were not covered by tests
<ModalHeader title={metadata?.name || "Payment Details"} />

<Spacer y="lg" />
Expand Down Expand Up @@ -268,6 +270,13 @@
/>
</div>
)}
<Spacer y="lg" />
{payUiOptions.showThirdwebBranding !== false && (
<>
<PoweredByThirdweb link="https://playground.thirdweb.com/connect/pay?utm_source=ub_text" />
<Spacer y="sm" />
</>

Check warning on line 278 in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx#L273-L278

Added lines #L273 - L278 were not covered by tests
)}
</Container>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import { Text } from "../../../components/text.js";
import { TokenSymbol } from "../../../components/token/TokenSymbol.js";
import { ConnectButton } from "../../ConnectButton.js";
import { PoweredByThirdweb } from "../../PoweredByTW.js";
import { OutlineWalletIcon } from "../../icons/OutlineWalletIcon.js";
import { formatTokenBalance } from "../formatTokenBalance.js";
import {
Expand Down Expand Up @@ -167,7 +168,8 @@
balanceQuery.data.value < transactionCostAndData.transactionValueWei;

return (
<Container p="lg">
<Container px="lg">
<Spacer y="lg" />

Check warning on line 172 in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx#L171-L172

Added lines #L171 - L172 were not covered by tests
<ModalHeader title={metadata?.name || "Transaction"} />

<Spacer y="lg" />
Expand Down Expand Up @@ -378,6 +380,13 @@
/>
</div>
)}
<Spacer y="lg" />
{payUiOptions.showThirdwebBranding !== false && (
<>
<PoweredByThirdweb link="https://playground.thirdweb.com/connect/pay?utm_source=ub_text" />
<Spacer y="sm" />
</>

Check warning on line 388 in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx#L383-L388

Added lines #L383 - L388 were not covered by tests
)}
</Container>
);
}
Loading