Skip to content

Commit a1f5b91

Browse files
state cleanup
1 parent 2b2b6cc commit a1f5b91

File tree

9 files changed

+6
-888
lines changed

9 files changed

+6
-888
lines changed

packages/thirdweb/src/pay/buyWithFiat/getStatus.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,13 @@ export type BuyWithFiatStatus =
5050
* - `NONE` - No status
5151
* - `PENDING_PAYMENT` - Payment is not done yet in the on-ramp provider
5252
* - `PAYMENT_FAILED` - Payment failed in the on-ramp provider
53-
* - `PENDING_ON_RAMP_TRANSFER` - Payment is done but the on-ramp provider is yet to transfer the tokens to the user's wallet
54-
* - `ON_RAMP_TRANSFER_IN_PROGRESS` - On-ramp provider is transferring the tokens to the user's wallet
5553
* - `ON_RAMP_TRANSFER_COMPLETED` - On-ramp provider has transferred the tokens to the user's wallet
56-
* - `ON_RAMP_TRANSFER_FAILED` - On-ramp provider failed to transfer the tokens to the user's wallet
57-
* - `CRYPTO_SWAP_REQUIRED` - On-ramp provider has sent the tokens to the user's wallet but a swap is required to convert it to the desired token
58-
* - `CRYPTO_SWAP_IN_PROGRESS` - Swap is in progress
59-
* - `CRYPTO_SWAP_COMPLETED` - Swap is completed and the user has received the desired token
60-
* - `CRYPTO_SWAP_FALLBACK` - Swap failed and the user has received a fallback token which is not the desired token
6154
*/
6255
status:
6356
| "NONE"
6457
| "PENDING_PAYMENT"
6558
| "PAYMENT_FAILED"
66-
| "PENDING_ON_RAMP_TRANSFER"
67-
| "ON_RAMP_TRANSFER_IN_PROGRESS"
68-
| "ON_RAMP_TRANSFER_COMPLETED"
69-
| "ON_RAMP_TRANSFER_FAILED"
70-
| "CRYPTO_SWAP_REQUIRED"
71-
| "CRYPTO_SWAP_COMPLETED"
72-
| "CRYPTO_SWAP_FALLBACK"
73-
| "CRYPTO_SWAP_IN_PROGRESS"
74-
| "CRYPTO_SWAP_FAILED";
59+
| "ON_RAMP_TRANSFER_COMPLETED";
7560
/**
7661
* The wallet address to which the desired tokens are sent to
7762
*/

packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatStatus.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ export function useBuyWithFiatStatus(
5151
const data = query.state.data as BuyWithFiatStatus;
5252
const status = data?.status;
5353
if (
54-
status === "ON_RAMP_TRANSFER_FAILED" ||
5554
status === "PAYMENT_FAILED" ||
56-
status === "CRYPTO_SWAP_COMPLETED" ||
5755
// onRampToken and toToken being the same means there is no additional swap step
5856
(status === "ON_RAMP_TRANSFER_COMPLETED" &&
5957
data?.quote.toToken.chainId === data?.quote.onRampToken.chainId &&

packages/thirdweb/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import { ExternalLinkIcon } from "@radix-ui/react-icons";
4-
import { useState } from "react";
54
import type { ThirdwebClient } from "../../../../client/client.js";
65
import { formatExplorerAddressUrl } from "../../../../utils/url.js";
76
import { iconSize } from "../../../core/design-system/index.js";
@@ -14,14 +13,10 @@ import { Spacer } from "../components/Spacer.js";
1413
import { Container, Line, ModalHeader } from "../components/basic.js";
1514
import { ButtonLink } from "../components/buttons.js";
1615
import type { ConnectLocale } from "./locale/types.js";
17-
import { TxDetailsScreen } from "./screens/Buy/pay-transactions/TxDetailsScreen.js";
18-
import type { TxStatusInfo } from "./screens/Buy/pay-transactions/useBuyTransactionsToShow.js";
1916
import type { PayerInfo } from "./screens/Buy/types.js";
2017
import { WalletTransactionHistory } from "./screens/WalletTransactionHistory.js";
2118
import type { WalletDetailsModalScreen } from "./screens/types.js";
2219

23-
//
24-
2520
/**
2621
* @internal
2722
*/
@@ -33,10 +28,6 @@ export function TransactionsScreen(props: {
3328
locale: ConnectLocale;
3429
client: ThirdwebClient;
3530
}) {
36-
// const [activeTab, setActiveTab] = useState("Transactions");
37-
// For now, you can only select pay transactions (purcahses)
38-
const [selectedTx, setSelectedTx] = useState<TxStatusInfo | null>(null);
39-
4031
const activeChain = useActiveWalletChain();
4132
const activeWallet = useActiveWallet();
4233
const activeAccount = useActiveAccount();
@@ -51,21 +42,6 @@ export function TransactionsScreen(props: {
5142
return <LoadingScreen />;
5243
}
5344

54-
if (selectedTx) {
55-
return (
56-
<TxDetailsScreen
57-
title={props.title}
58-
client={props.client}
59-
statusInfo={selectedTx}
60-
onBack={() => setSelectedTx(null)}
61-
onDone={() => setSelectedTx(null)}
62-
payer={payer}
63-
transactionMode={false}
64-
isEmbed={false}
65-
/>
66-
);
67-
}
68-
6945
return (
7046
<Container animate="fadein">
7147
<Container p="lg">
@@ -80,40 +56,11 @@ export function TransactionsScreen(props: {
8056
}}
8157
>
8258
<Spacer y="md" />
83-
{/* <Tabs */}
84-
{/* options={[ */}
85-
{/* {
86-
label: (
87-
<span className="flex gap-2">
88-
<CoinsIcon size={iconSize.sm} /> Transactions
89-
</span>
90-
),
91-
value: "Transactions",
92-
// },
93-
// TODO (UB): add back in once we have a way to show purchases with new service
94-
// {
95-
// label: (
96-
// <span className="flex gap-2">
97-
// <FundsIcon size={iconSize.sm} /> Purchases
98-
// </span>
99-
// ),
100-
// value: "Purchases",
101-
// },
102-
// ]}
103-
// selected={activeTab}
104-
// onSelect={setActiveTab}
105-
{/* > */}
106-
{/* {activeTab === "Purchases" && ( */}
107-
{/* <PayTxHistoryList client={props.client} onSelectTx={setSelectedTx} /> */}
108-
{/* )} */}
109-
{/* {activeTab === "Transactions" && ( */}
11059
<WalletTransactionHistory
11160
locale={props.locale}
11261
client={props.client}
11362
address={payer.account.address}
11463
/>
115-
{/* })} */}
116-
{/* </Tabs> */}
11764
</Container>
11865
<Line />
11966
<Container p="lg">

0 commit comments

Comments
 (0)