Skip to content

Commit 76cfecb

Browse files
authored
[Dashboard] Feature: Update payment success copy on payment page (#7936)
1 parent f33d8f1 commit 76cfecb

File tree

5 files changed

+37
-4
lines changed

5 files changed

+37
-4
lines changed

.changeset/cuddly-results-play.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+
Updates copy on the payment widgets

apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export function PayPageWidget({
6060
createWallet("io.metamask"),
6161
createWallet("io.rabby"),
6262
createWallet("com.okex.wallet"),
63+
createWallet("me.rainbow"),
6364
createWallet("walletConnect"),
6465
],
6566
showAllWallets: true,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ export function BridgeOrchestrator({
389389
preparedQuote={state.context.quote}
390390
uiOptions={uiOptions}
391391
windowAdapter={webWindowAdapter}
392+
hasPaymentId={!!paymentLinkId}
392393
/>
393394
)}
394395

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ export interface SuccessScreenProps {
4242
windowAdapter: WindowAdapter;
4343

4444
client: ThirdwebClient;
45+
46+
/**
47+
* Whether or not this payment is associated with a payment ID. If it does, we show a different message.
48+
*/
49+
hasPaymentId?: boolean;
4550
}
4651

4752
type ViewState = "success" | "detail";
@@ -53,6 +58,7 @@ export function SuccessScreen({
5358
onDone,
5459
windowAdapter,
5560
client,
61+
hasPaymentId = false,
5662
}: SuccessScreenProps) {
5763
const theme = useCustomTheme();
5864
const [viewState, setViewState] = useState<ViewState>("success");
@@ -120,7 +126,11 @@ export function SuccessScreen({
120126
</Text>
121127

122128
<Text center color="secondaryText" size="sm">
123-
Your cross-chain payment has been completed successfully.
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."}
124134
</Text>
125135
</Container>
126136
<Spacer y="lg" />
@@ -135,9 +145,11 @@ export function SuccessScreen({
135145
View Payment Receipt
136146
</Button>
137147

138-
<Button fullWidth onClick={onDone} variant="accent">
139-
{uiOptions.mode === "transaction" ? "Continue" : "Done"}
140-
</Button>
148+
{!hasPaymentId && (
149+
<Button fullWidth onClick={onDone} variant="accent">
150+
{uiOptions.mode === "transaction" ? "Continue" : "Done"}
151+
</Button>
152+
)}
141153
</Container>
142154

143155
{/* CSS Animations */}

packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,17 @@ export const TransactionPayment: Story = {
222222
backgrounds: { default: "light" },
223223
},
224224
};
225+
226+
export const PaymentId: Story = {
227+
args: {
228+
client: storyClient,
229+
completedStatuses: mockBuyCompletedStatuses,
230+
hasPaymentId: true,
231+
preparedQuote: simpleBuyQuote,
232+
theme: "light",
233+
uiOptions: TRANSACTION_UI_OPTIONS.contractInteraction,
234+
},
235+
parameters: {
236+
backgrounds: { default: "light" },
237+
},
238+
};

0 commit comments

Comments
 (0)