Skip to content

Commit

Permalink
add swap and fix donate (#72)
Browse files Browse the repository at this point in the history
* updated useContractCalls and much of DonateComponent

* added useApproveSwapTokenCallback and useSwapRoute

* draft swap integration

* added index to hooks/useContractCalls

* prevented swap from G$ to G$

* fixed formatting and some swap bugs

* removed unused function from lib

* now using celo token list

* removed unused import

* made dropdown menu scrollable

* swap works!

* adjustments to reflect uniswap default slippage tolerance

* fixed jsbi via vite configuration

* changed priceImpact to number

* removed unused `WalletConnectionProvider` context

* by request, handleApproveToken is no longer memoized

* fixed GD formatting in Donor List

* changed acceptable price impact percent to 5% and moved it to constants.ts
  • Loading branch information
krisbitney authored Jan 9, 2024
1 parent 0a76140 commit 6798a21
Show file tree
Hide file tree
Showing 51 changed files with 1,661 additions and 584 deletions.
5 changes: 3 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
"@celo-tools/celo-ethers-wrapper": "^0.4.0",
"@ethersproject/shims": "^5.7.0",
"@gooddollar/good-design": "^0.1.31",
"@gooddollar/goodcollective-sdk": "^1.*",
"@gooddollar/goodcollective-sdk": "^1.0.6",
"@gooddollar/web3sdk-v2": "^0.2.2",
"@react-native-aria/interactions": "0.2.3",
"@react-native-async-storage/async-storage": "^1.18.2",
"@react-native-firebase/analytics": "16.7.0",
"@react-native-firebase/app": "16.7.0",
"@superfluid-finance/sdk-core": "^0.3.2",
"@uniswap/router-sdk": "^1.7.1",
"@uniswap/sdk-core": "^4.0.7",
"@uniswap/smart-order-router": "^3.16.23",
"@uniswap/smart-order-router": "^3.20.0",
"@uniswap/v3-sdk": "^3.10.0",
"@usedapp/core": "^1.2.10",
"@wagmi/core": "^1.4.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ interface AproveSwapModalProps {
setOpenModal: any;
}

const AproveSwapModal = ({ openModal, setOpenModal }: AproveSwapModalProps) => {
const ApproveSwapModal = ({ openModal, setOpenModal }: AproveSwapModalProps) => {
return (
<View style={styles.centeredView}>
<Modal animationType="slide" transparent={true} visible={openModal}>
<View style={styles.centeredView}>
<View style={styles.modalView}>
<View style={modalStyles.modalCloseIconWrapper}>
<TouchableOpacity style={modalStyles.modalCloseIcon}>
<TouchableOpacity
style={modalStyles.modalCloseIcon}
onPress={() => {
setOpenModal(false);
}}>
<Image source={CloseIcon} style={styles.closeIcon} />
</TouchableOpacity>
</View>
<Text style={styles.title}>APROVE TOKEN SWAP</Text>
<Text style={styles.title}>APPROVE TOKEN SWAP</Text>
<Text style={styles.paragraph}>
To approve the exchange from your donation currency to this GoodCollective's currency, sign with your
wallet.
Expand Down Expand Up @@ -112,4 +116,4 @@ const styles = StyleSheet.create({
},
});

export default AproveSwapModal;
export default ApproveSwapModal;
1 change: 0 additions & 1 deletion packages/app/src/components/CompleteDonationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const CompleteDonationModal = ({ openModal, setOpenModal }: CompleteDonationModa
style={modalStyles.modalCloseIcon}
onPress={() => {
setOpenModal(false);
console.log(openModal);
}}>
<Image source={CloseIcon} style={styles.closeIcon} />
</TouchableOpacity>
Expand Down
8 changes: 0 additions & 8 deletions packages/app/src/components/ConnectWallet.tsx

This file was deleted.

Loading

0 comments on commit 6798a21

Please sign in to comment.