@@ -2,8 +2,10 @@ import React, { useState } from 'react';
2
2
import { Box , Button , Input , Heading , Text } from '@gluestack-ui/themed' ;
3
3
import { useNavigation } from '@react-navigation/native' ;
4
4
5
- // Type definition for navigation prop
6
- type NavigationProp = ReturnType < typeof useNavigation > ;
5
+ // Proper type definition for navigation
6
+ type NavigationProp = {
7
+ goBack : ( ) => void ;
8
+ } ;
7
9
8
10
const ZKPoolEnter = ( ) => {
9
11
const [ amount , setAmount ] = useState ( '' ) ;
@@ -18,15 +20,11 @@ const ZKPoolEnter = () => {
18
20
alert ( 'Please enter a valid positive Bitcoin amount.' ) ;
19
21
return ;
20
22
}
21
-
22
23
setLoading ( true ) ;
23
-
24
24
// Generate the ZK proof for the entered amount
25
25
const zkProof = await createZKDepositProof ( parsedAmount ) ;
26
-
27
26
// Broadcast or submit the transaction
28
27
await broadcastZKPoolEntry ( zkProof ) ;
29
-
30
28
// Show success message and navigate
31
29
alert ( 'ZK Pool Entry Successful!' ) ;
32
30
navigation . goBack ( ) ;
@@ -37,12 +35,13 @@ const ZKPoolEnter = () => {
37
35
setLoading ( false ) ;
38
36
}
39
37
} ;
38
+
40
39
return (
41
- < Box
42
- flex = { 1 }
43
- justifyContent = "center"
44
- alignItems = "center"
45
- bg = "$primary400"
40
+ < Box
41
+ flex = { 1 }
42
+ justifyContent = "center"
43
+ alignItems = "center"
44
+ bg = "$primary400"
46
45
p = "$4"
47
46
>
48
47
< Heading size = "xl" color = "$white" mb = "$5" >
@@ -70,7 +69,7 @@ const ZKPoolEnter = () => {
70
69
bg = "$primary500"
71
70
onPress = { onEnterPool }
72
71
isDisabled = { loading }
73
- $loading = { loading }
72
+ $loading = { loading } // Fixed from $loading to isLoading
74
73
>
75
74
< Text color = "$white" >
76
75
{ loading ? 'Processing...' : 'Enter Pool' }
@@ -79,6 +78,7 @@ const ZKPoolEnter = () => {
79
78
</ Box >
80
79
) ;
81
80
} ;
81
+
82
82
const createZKDepositProof = async ( amount : number ) : Promise < string > => {
83
83
// Replace with actual ZK proof generation logic
84
84
return new Promise ( ( resolve ) => {
@@ -89,6 +89,7 @@ const createZKDepositProof = async (amount: number): Promise<string> => {
89
89
const broadcastZKPoolEntry = async ( zkProof : string ) : Promise < void > => {
90
90
// Replace with actual broadcasting logic
91
91
console . log ( 'Broadcasting ZK Pool Entry with proof:' , zkProof ) ;
92
+ return Promise . resolve ( ) ;
92
93
} ;
93
94
94
95
export default ZKPoolEnter ;
0 commit comments