@@ -5,6 +5,7 @@ import { useLocalStorage } from "usehooks-ts";
5
5
6
6
import { SignPsbtTransaction } from "@/app/common/utils/psbt" ;
7
7
import { LoadingTableList } from "@/app/components/Loading/Loading" ;
8
+ import { DelegationsPointsProvider } from "@/app/context/api/DelegationsPointsProvider" ;
8
9
import { useError } from "@/app/context/Error/ErrorContext" ;
9
10
import { QueryMeta } from "@/app/types/api" ;
10
11
import {
@@ -39,19 +40,56 @@ interface DelegationsProps {
39
40
pushTx : WalletProvider [ "pushTx" ] ;
40
41
queryMeta : QueryMeta ;
41
42
getNetworkFees : WalletProvider [ "getNetworkFees" ] ;
43
+ isWalletConnected : boolean ;
42
44
}
43
45
44
46
export const Delegations : React . FC < DelegationsProps > = ( {
45
47
delegationsAPI,
46
48
delegationsLocalStorage,
47
49
globalParamsVersion,
48
- publicKeyNoCoord,
49
- btcWalletNetwork,
50
+ signPsbtTx,
51
+ pushTx,
52
+ queryMeta,
53
+ getNetworkFees,
50
54
address,
55
+ btcWalletNetwork,
56
+ publicKeyNoCoord,
57
+ isWalletConnected,
58
+ } ) => {
59
+ return (
60
+ < DelegationsPointsProvider
61
+ publicKeyNoCoord = { publicKeyNoCoord }
62
+ delegationsAPI = { delegationsAPI }
63
+ isWalletConnected = { isWalletConnected }
64
+ >
65
+ < DelegationsContent
66
+ delegationsAPI = { delegationsAPI }
67
+ delegationsLocalStorage = { delegationsLocalStorage }
68
+ globalParamsVersion = { globalParamsVersion }
69
+ signPsbtTx = { signPsbtTx }
70
+ pushTx = { pushTx }
71
+ queryMeta = { queryMeta }
72
+ getNetworkFees = { getNetworkFees }
73
+ address = { address }
74
+ btcWalletNetwork = { btcWalletNetwork }
75
+ publicKeyNoCoord = { publicKeyNoCoord }
76
+ isWalletConnected = { isWalletConnected }
77
+ />
78
+ </ DelegationsPointsProvider >
79
+ ) ;
80
+ } ;
81
+
82
+ const DelegationsContent : React . FC < DelegationsProps > = ( {
83
+ delegationsAPI,
84
+ delegationsLocalStorage,
85
+ globalParamsVersion,
51
86
signPsbtTx,
52
87
pushTx,
53
88
queryMeta,
54
89
getNetworkFees,
90
+ address,
91
+ btcWalletNetwork,
92
+ publicKeyNoCoord,
55
93
} ) => {
56
94
const [ modalOpen , setModalOpen ] = useState ( false ) ;
57
95
const [ txID , setTxID ] = useState ( "" ) ;
@@ -113,7 +151,7 @@ export const Delegations: React.FC<DelegationsProps> = ({
113
151
id ,
114
152
delegationsAPI ,
115
153
publicKeyNoCoord ,
116
- btcWalletNetwork ,
154
+ btcWalletNetwork ! ,
117
155
signPsbtTx ,
118
156
) ;
119
157
// Update the local state with the new intermediate delegation
@@ -143,7 +181,7 @@ export const Delegations: React.FC<DelegationsProps> = ({
143
181
id ,
144
182
delegationsAPI ,
145
183
publicKeyNoCoord ,
146
- btcWalletNetwork ,
184
+ btcWalletNetwork ! ,
147
185
signPsbtTx ,
148
186
address ,
149
187
getNetworkFees ,
@@ -233,11 +271,12 @@ export const Delegations: React.FC<DelegationsProps> = ({
233
271
</ div >
234
272
) : (
235
273
< >
236
- < div className = "hidden grid-cols-5 gap-2 px-4 lg:grid" >
274
+ < div className = "hidden grid-cols-6 gap-2 px-4 lg:grid" >
237
275
< p > Amount</ p >
238
276
< p > Inception</ p >
239
277
< p className = "text-center" > Transaction hash</ p >
240
278
< p className = "text-center" > Status</ p >
279
+ < p className = "text-center" > Points</ p >
241
280
< p > Action</ p >
242
281
</ div >
243
282
< div
0 commit comments