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/cuddly-results-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Updates copy on the payment widgets
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function PayPageWidget({
createWallet("io.metamask"),
createWallet("io.rabby"),
createWallet("com.okex.wallet"),
createWallet("me.rainbow"),
createWallet("walletConnect"),
],
showAllWallets: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@
preparedQuote={state.context.quote}
uiOptions={uiOptions}
windowAdapter={webWindowAdapter}
hasPaymentId={!!paymentLinkId}

Check warning on line 392 in packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx

View check run for this annotation

Codecov / codecov/patch

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

Added line #L392 was not covered by tests
/>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
windowAdapter: WindowAdapter;

client: ThirdwebClient;

/**
* Whether or not this payment is associated with a payment ID. If it does, we show a different message.
*/
hasPaymentId?: boolean;
}

type ViewState = "success" | "detail";
Expand All @@ -53,6 +58,7 @@
onDone,
windowAdapter,
client,
hasPaymentId = false,

Check warning on line 61 in packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx

View check run for this annotation

Codecov / codecov/patch

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

Added line #L61 was not covered by tests
}: SuccessScreenProps) {
const theme = useCustomTheme();
const [viewState, setViewState] = useState<ViewState>("success");
Expand Down Expand Up @@ -120,7 +126,11 @@
</Text>

<Text center color="secondaryText" size="sm">
Your cross-chain payment has been completed successfully.
{hasPaymentId
? "You can now close this page and return to the application."
: uiOptions.mode === "transaction"
? "Click continue to execute your transaction."
: "Your payment has been completed successfully."}

Check warning on line 133 in packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L129 - L133 were not covered by tests
</Text>
</Container>
<Spacer y="lg" />
Expand All @@ -135,9 +145,11 @@
View Payment Receipt
</Button>

<Button fullWidth onClick={onDone} variant="accent">
{uiOptions.mode === "transaction" ? "Continue" : "Done"}
</Button>
{!hasPaymentId && (
<Button fullWidth onClick={onDone} variant="accent">
{uiOptions.mode === "transaction" ? "Continue" : "Done"}
</Button>

Check warning on line 151 in packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L148 - L151 were not covered by tests
)}
</Container>

{/* CSS Animations */}
Expand Down
14 changes: 14 additions & 0 deletions packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,17 @@ export const TransactionPayment: Story = {
backgrounds: { default: "light" },
},
};

export const PaymentId: Story = {
args: {
client: storyClient,
completedStatuses: mockBuyCompletedStatuses,
hasPaymentId: true,
preparedQuote: simpleBuyQuote,
theme: "light",
uiOptions: TRANSACTION_UI_OPTIONS.contractInteraction,
},
parameters: {
backgrounds: { default: "light" },
},
};
Loading