Skip to content

Commit cd58cdf

Browse files
authored
Merge branch 'main' into cursor/replace-payembed-with-buywidget-code-4a6a
2 parents 1f57b7c + bfd728a commit cd58cdf

File tree

14 files changed

+122
-39
lines changed

14 files changed

+122
-39
lines changed

.changeset/hip-mammals-sip.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+
Adds the ability to hide thirdweb branding in the payment widgets with showThirdwebBranding

apps/playground-web/src/app/connect/pay/components/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ export type BridgeComponentsPlaygroundOptions = {
2525
transactionData?: string; // Simplified for demo; could be more complex in real implementation
2626

2727
paymentMethods: ("crypto" | "card")[];
28+
29+
showThirdwebBranding: boolean;
2830
};
2931
};

apps/playground-web/src/app/connect/pay/embed/LeftSection.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,23 @@ export function LeftSection(props: {
464464
}}
465465
theme={options.theme}
466466
/>
467+
468+
<div className="my-4 flex items-center gap-2">
469+
<Checkbox
470+
checked={payOptions.showThirdwebBranding}
471+
id={"branding"}
472+
onCheckedChange={(checked) => {
473+
setOptions((v) => ({
474+
...v,
475+
payOptions: {
476+
...v.payOptions,
477+
showThirdwebBranding: checked === true,
478+
},
479+
}));
480+
}}
481+
/>
482+
<Label htmlFor={"branding"}>Show Branding</Label>
483+
</div>
467484
</CollapsibleSection>
468485

469486
<CollapsibleSection icon={FuelIcon} title="Sponsor gas fees">

apps/playground-web/src/app/connect/pay/embed/RightSection.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export function RightSection(props: {
6464
theme={themeObj}
6565
title={props.options.payOptions.title}
6666
tokenAddress={props.options.payOptions.buyTokenAddress}
67+
showThirdwebBranding={props.options.payOptions.showThirdwebBranding}
6768
/>
6869
);
6970
}
@@ -87,6 +88,7 @@ export function RightSection(props: {
8788
seller={props.options.payOptions.sellerAddress}
8889
theme={themeObj}
8990
tokenAddress={props.options.payOptions.buyTokenAddress}
91+
showThirdwebBranding={props.options.payOptions.showThirdwebBranding}
9092
/>
9193
);
9294
}
@@ -106,6 +108,7 @@ export function RightSection(props: {
106108
to: account?.address || "",
107109
tokenId: 2n,
108110
})}
111+
showThirdwebBranding={props.options.payOptions.showThirdwebBranding}
109112
/>
110113
);
111114
}

apps/playground-web/src/app/connect/pay/embed/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const defaultConnectOptions: BridgeComponentsPlaygroundOptions = {
1818
title: "",
1919
transactionData: "",
2020
widget: "buy",
21+
showThirdwebBranding: true,
2122
},
2223
theme: {
2324
darkColorOverrides: {},

apps/portal/src/app/Header.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ const links = [
5151
href: "/insight",
5252
name: "Insight",
5353
},
54-
{
55-
href: "/nebula",
56-
name: "Nebula",
57-
},
5854
{
5955
href: "/vault",
6056
name: "Vault",
@@ -127,10 +123,6 @@ export const connectLinks: Array<{
127123
] as const;
128124

129125
const apisLinks = [
130-
{
131-
href: "/nebula/api-reference",
132-
name: "Nebula",
133-
},
134126
{
135127
href: "https://insight.thirdweb.com/reference",
136128
name: "Insight",

apps/portal/src/app/page.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { BridgeIcon } from "../icons/products/BridgeIcon";
1414
import { ConnectIcon } from "../icons/products/ConnectIcon";
1515
import { EngineIcon } from "../icons/products/EngineIcon";
1616
import { InsightIcon } from "../icons/products/InsightIcon";
17-
import { NebulaIcon } from "../icons/products/NebulaIcon";
1817
import { PlaygroundIcon } from "../icons/products/PlaygroundIcon";
1918
import { cn } from "../lib/utils";
2019
import DocsHeroDark from "./_images/docs-hero-dark.png";
@@ -148,12 +147,6 @@ function ReferenceSection() {
148147
iconClassName="text-muted-foreground"
149148
title="Bundler"
150149
/>
151-
<SDKCard
152-
href="/nebula/api-reference"
153-
icon={NebulaIcon} // TODO: actual openAPI docs
154-
iconClassName="text-muted-foreground"
155-
title="Nebula"
156-
/>
157150
</Grid>
158151
</section>
159152
);
@@ -194,16 +187,10 @@ function LearningResourcesSection() {
194187
icon={InsightIcon}
195188
title="Insight"
196189
/>
197-
<ArticleCardIndex
198-
description="API interface for LLMs"
199-
href="/nebula"
200-
icon={NebulaIcon}
201-
title="Nebula"
202-
/>
203190
<ArticleCardIndex
204191
description="Non-custodial key management service"
205192
href="/vault"
206-
icon={NebulaIcon}
193+
icon={ConnectIcon}
207194
title="Vault"
208195
/>
209196
</Grid>

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ export interface BridgeOrchestratorProps {
120120
* @default ["crypto", "card"]
121121
*/
122122
paymentMethods?: ("crypto" | "card")[];
123+
124+
/**
125+
* Whether to show thirdweb branding in the widget.
126+
* @default true
127+
*/
128+
showThirdwebBranding?: boolean;
123129
}
124130

125131
export function BridgeOrchestrator({
@@ -135,6 +141,7 @@ export function BridgeOrchestrator({
135141
paymentLinkId,
136142
presetOptions,
137143
paymentMethods = ["crypto", "card"],
144+
showThirdwebBranding = true,
138145
}: BridgeOrchestratorProps) {
139146
// Initialize adapters
140147
const adapters = useMemo(
@@ -145,6 +152,18 @@ export function BridgeOrchestrator({
145152
[],
146153
);
147154

155+
// Create modified connect options with branding setting
156+
const modifiedConnectOptions = useMemo(() => {
157+
if (!connectOptions) return undefined;
158+
return {
159+
...connectOptions,
160+
connectModal: {
161+
...connectOptions.connectModal,
162+
showThirdwebBranding,
163+
},
164+
};
165+
}, [connectOptions, showThirdwebBranding]);
166+
148167
// Use the payment machine hook
149168
const [state, send] = usePaymentMachine(adapters, uiOptions.mode);
150169

@@ -239,28 +258,31 @@ export function BridgeOrchestrator({
239258
{state.value === "init" && uiOptions.mode === "fund_wallet" && (
240259
<FundWallet
241260
client={client}
242-
connectOptions={connectOptions}
261+
connectOptions={modifiedConnectOptions}
243262
onContinue={handleRequirementsResolved}
244263
presetOptions={presetOptions}
245264
receiverAddress={receiverAddress}
265+
showThirdwebBranding={showThirdwebBranding}
246266
uiOptions={uiOptions}
247267
/>
248268
)}
249269

250270
{state.value === "init" && uiOptions.mode === "direct_payment" && (
251271
<DirectPayment
252272
client={client}
253-
connectOptions={connectOptions}
273+
connectOptions={modifiedConnectOptions}
254274
onContinue={handleRequirementsResolved}
275+
showThirdwebBranding={showThirdwebBranding}
255276
uiOptions={uiOptions}
256277
/>
257278
)}
258279

259280
{state.value === "init" && uiOptions.mode === "transaction" && (
260281
<TransactionPayment
261282
client={client}
262-
connectOptions={connectOptions}
283+
connectOptions={modifiedConnectOptions}
263284
onContinue={handleRequirementsResolved}
285+
showThirdwebBranding={showThirdwebBranding}
264286
uiOptions={uiOptions}
265287
/>
266288
)}
@@ -272,7 +294,7 @@ export function BridgeOrchestrator({
272294
<PaymentSelection
273295
client={client}
274296
connectLocale={connectLocale || en}
275-
connectOptions={connectOptions}
297+
connectOptions={modifiedConnectOptions}
276298
destinationAmount={state.context.destinationAmount}
277299
destinationToken={state.context.destinationToken}
278300
feePayer={

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ export type BuyWidgetProps = {
102102

103103
className?: string;
104104

105+
/**
106+
* Whether to show thirdweb branding in the widget.
107+
* @default true
108+
*/
109+
showThirdwebBranding?: boolean;
110+
105111
/**
106112
* The chain the accepted token is on.
107113
*/
@@ -391,6 +397,7 @@ export function BuyWidget(props: BuyWidgetProps) {
391397
purchaseData={props.purchaseData}
392398
receiverAddress={undefined}
393399
uiOptions={bridgeDataQuery.data.data}
400+
showThirdwebBranding={props.showThirdwebBranding}
394401
/>
395402
);
396403
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ export type CheckoutWidgetProps = {
9898

9999
className?: string;
100100

101+
/**
102+
* Whether to show thirdweb branding in the widget.
103+
* @default true
104+
*/
105+
showThirdwebBranding?: boolean;
106+
101107
/**
102108
* The chain the accepted token is on.
103109
*/
@@ -353,6 +359,7 @@ export function CheckoutWidget(props: CheckoutWidgetProps) {
353359
presetOptions={props.presetOptions}
354360
purchaseData={props.purchaseData}
355361
receiverAddress={props.seller}
362+
showThirdwebBranding={props.showThirdwebBranding}
356363
uiOptions={bridgeDataQuery.data.data}
357364
/>
358365
);

0 commit comments

Comments
 (0)