diff --git a/.changeset/happy-dots-jam.md b/.changeset/happy-dots-jam.md new file mode 100644 index 00000000000..deb9be575ca --- /dev/null +++ b/.changeset/happy-dots-jam.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Update success message shown in SwapWidget component diff --git a/packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx b/packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx index 34ca753fc80..ce1bc57231a 100644 --- a/packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx +++ b/packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx @@ -723,6 +723,7 @@ function BridgeWidgetContent( if (screen.id === "6:success") { return ( ("success"); @@ -112,6 +115,13 @@ export function SuccessScreen({ ); } + const title = + type === "swap-success" ? "Swap Successful" : "Payment Successful"; + const description = + type === "swap-success" + ? "Your token swap has been completed successfully." + : "Your payment has been completed successfully."; + return ( @@ -151,7 +161,7 @@ export function SuccessScreen({ marginBottom: spacing.xxs, }} > - Payment Successful + {title} @@ -159,7 +169,7 @@ export function SuccessScreen({ ? "You can now close this page and return to the application." : showContinueWithTx ? "Click continue to execute your transaction." - : "Your payment has been completed successfully."} + : description} @@ -173,7 +183,7 @@ export function SuccessScreen({ onClick={() => setViewState("detail")} variant="secondary" > - View Payment Receipt + View Transaction Receipt {!hasPaymentId && ( diff --git a/packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx b/packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx index 547dd2abd18..0aef7b9f934 100644 --- a/packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx +++ b/packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx @@ -440,6 +440,7 @@ function SwapWidgetContent( if (screen.id === "4:success") { return ( { diff --git a/packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx b/packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx index 3913b59426b..0b4e8cda3ec 100644 --- a/packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx +++ b/packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx @@ -75,6 +75,7 @@ const meta: Meta = { windowAdapter: webWindowAdapter, client: storyClient, hasPaymentId: false, + type: "payment-success", }, component: SuccessScreen, decorators: [ @@ -94,6 +95,12 @@ export const Basic: Story = { args: {}, }; +export const BasicSwapSuccess: Story = { + args: { + type: "swap-success", + }, +}; + export const OnrampPayment: Story = { args: { completedStatuses: mockOnrampCompletedStatuses,