-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from alchemix-finance/feat/token-adapter-adjus…
…ted-withdraw FEAT: Dynamic withdraw amount of Aave yield bearing tokens, Connect Wallet Cta Button, Refactors
- Loading branch information
Showing
22 changed files
with
926 additions
and
298 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { useAccount } from "wagmi"; | ||
import { Button } from "../ui/button"; | ||
import { useConnectModal } from "@rainbow-me/rainbowkit"; | ||
import { ComponentPropsWithRef } from "react"; | ||
|
||
/** | ||
* Button that opens connect modal if the user is not connected. | ||
*/ | ||
export const CtaButton = (props: ComponentPropsWithRef<typeof Button>) => { | ||
const { address } = useAccount(); | ||
const { openConnectModal } = useConnectModal(); | ||
return ( | ||
<Button | ||
{...props} | ||
onClick={!address ? openConnectModal : props.onClick} | ||
disabled={!address ? false : props.disabled} | ||
> | ||
{!address ? "Connect Wallet" : props.children} | ||
</Button> | ||
); | ||
}; |
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
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.