-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrating wallet connection with AAVE
- Loading branch information
Jakub Vonášek
committed
Feb 1, 2024
1 parent
1db84cc
commit 48d6241
Showing
10 changed files
with
162 additions
and
704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 4 additions & 27 deletions
31
src/sections/lending/components/WalletConnection/ConnectWalletButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,10 @@ | ||
import { Button } from "@mui/material" | ||
import React, { lazy, Suspense } from "react" | ||
import { useWalletModalContext } from "sections/lending/hooks/useWalletModal" | ||
|
||
const WalletModal = lazy(async () => ({ | ||
default: (await import("./WalletModal.js")).WalletModal, | ||
})) | ||
import React from "react" | ||
import { Web3ConnectModalButton } from "sections/web3-connect/modal/Web3ConnectModalButton" | ||
|
||
export interface ConnectWalletProps { | ||
funnel?: string | ||
} | ||
|
||
export const ConnectWalletButton: React.FC<ConnectWalletProps> = ({ | ||
funnel, | ||
}) => { | ||
const { setWalletModalOpen } = useWalletModalContext() | ||
|
||
return ( | ||
<> | ||
<Button | ||
variant="gradient" | ||
onClick={() => { | ||
setWalletModalOpen(true) | ||
}} | ||
> | ||
<span>Connect wallet</span> | ||
</Button> | ||
<Suspense> | ||
<WalletModal /> | ||
</Suspense> | ||
</> | ||
) | ||
export const ConnectWalletButton: React.FC<ConnectWalletProps> = () => { | ||
return <Web3ConnectModalButton /> | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.