Skip to content

Commit 2d7cb9a

Browse files
committed
Fix
1 parent 65052f9 commit 2d7cb9a

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/navigation/ZKPoolEnter.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import React, { useState } from 'react';
22
import { Box, Button, Input, Heading, Text } from '@gluestack-ui/themed';
33
import { useNavigation } from '@react-navigation/native';
44

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+
};
79

810
const ZKPoolEnter = () => {
911
const [amount, setAmount] = useState('');
@@ -18,15 +20,11 @@ const ZKPoolEnter = () => {
1820
alert('Please enter a valid positive Bitcoin amount.');
1921
return;
2022
}
21-
2223
setLoading(true);
23-
2424
// Generate the ZK proof for the entered amount
2525
const zkProof = await createZKDepositProof(parsedAmount);
26-
2726
// Broadcast or submit the transaction
2827
await broadcastZKPoolEntry(zkProof);
29-
3028
// Show success message and navigate
3129
alert('ZK Pool Entry Successful!');
3230
navigation.goBack();
@@ -37,12 +35,13 @@ const ZKPoolEnter = () => {
3735
setLoading(false);
3836
}
3937
};
38+
4039
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"
4645
p="$4"
4746
>
4847
<Heading size="xl" color="$white" mb="$5">
@@ -70,7 +69,7 @@ const ZKPoolEnter = () => {
7069
bg="$primary500"
7170
onPress={onEnterPool}
7271
isDisabled={loading}
73-
$loading={loading}
72+
$loading={loading} // Fixed from $loading to isLoading
7473
>
7574
<Text color="$white">
7675
{loading ? 'Processing...' : 'Enter Pool'}
@@ -79,6 +78,7 @@ const ZKPoolEnter = () => {
7978
</Box>
8079
);
8180
};
81+
8282
const createZKDepositProof = async (amount: number): Promise<string> => {
8383
// Replace with actual ZK proof generation logic
8484
return new Promise((resolve) => {
@@ -89,6 +89,7 @@ const createZKDepositProof = async (amount: number): Promise<string> => {
8989
const broadcastZKPoolEntry = async (zkProof: string): Promise<void> => {
9090
// Replace with actual broadcasting logic
9191
console.log('Broadcasting ZK Pool Entry with proof:', zkProof);
92+
return Promise.resolve();
9293
};
9394

9495
export default ZKPoolEnter;

0 commit comments

Comments
 (0)