Skip to content

Commit 68b48f4

Browse files
committed
[MNY-232] SDK: Fix ExecutingTxScreen missing back button in TransactionWidget (#8193)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating the `onBack` functionality in the `TransactionWidget` and `TransactionModal` components, ensuring that the back navigation behavior is more consistent across these components. ### Detailed summary - In `TransactionWidget.tsx`, `onBack` now sets the screen to `init-ui`. - In `TransactionModal.tsx`, `onBack` sets the screen to `deposit`. - In `ExecutingScreen.tsx`, the `onBack` prop is changed from optional to required. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added back navigation from the executing transaction screen, allowing users to return to the previous step without closing the modal. * Unified back-button behavior across transaction flows for a more consistent experience. * Provides clearer control during long-running executions with an explicit back option. * Navigation enhancement applies to both bridge and transaction modal flows, improving step-to-step control while keeping transaction processing unchanged. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 1c660d4 commit 68b48f4

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,9 @@ function TransactionWidgetContent(
770770
if (screen.id === "execute-tx") {
771771
return (
772772
<ExecutingTxScreen
773+
onBack={() => {
774+
setScreen({ id: "init-ui" });
775+
}}
773776
closeModal={() => {
774777
setScreen({ id: "init-ui" });
775778
}}

packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function ExecutingTxScreen(props: {
2020
tx: PreparedTransaction;
2121
closeModal: () => void;
2222
onTxSent: (data: WaitForReceiptOptions) => void;
23-
onBack?: () => void;
23+
onBack: (() => void) | undefined;
2424
windowAdapter: WindowAdapter;
2525
}) {
2626
const sendTxCore = useSendTransaction({

packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ function DepositAndExecuteTx(props: ModalProps) {
133133
if (screen === "execute-tx") {
134134
return (
135135
<ExecutingTxScreen
136+
onBack={() => {
137+
setScreen("deposit");
138+
}}
136139
closeModal={props.onClose}
137140
onTxSent={props.onTxSent}
138141
tx={props.tx}

0 commit comments

Comments
 (0)