diff --git a/src/components/BorrowInput/index.tsx b/src/components/BorrowInput/index.tsx index b0da37e..f0c6740 100644 --- a/src/components/BorrowInput/index.tsx +++ b/src/components/BorrowInput/index.tsx @@ -10,7 +10,7 @@ import { LendingReserveParser, } from "../../models"; import { TokenIcon } from "../TokenIcon"; -import { Button, Card } from "antd"; +import { Card } from "antd"; import { cache, ParsedAccount } from "../../contexts/accounts"; import { NumericInput } from "../Input/numeric"; import { useConnection } from "../../contexts/connection"; @@ -21,6 +21,7 @@ import "./style.less"; import { LABELS } from "../../constants"; import { ActionConfirmation } from "./../ActionConfirmation"; import { BackButton } from "./../BackButton"; +import { ConnectButton } from "../ConnectButton"; export const BorrowInput = (props: { className?: string; @@ -150,14 +151,14 @@ export const BorrowInput = (props: { />
{name}
- + {fromAccounts.length === 0 ? LABELS.NO_DEPOSITS : LABELS.BORROW_ACTION} + )} diff --git a/src/components/ConnectButton/index.tsx b/src/components/ConnectButton/index.tsx index 1c83076..63d7c23 100644 --- a/src/components/ConnectButton/index.tsx +++ b/src/components/ConnectButton/index.tsx @@ -8,9 +8,9 @@ export const ConnectButton = ( props: ButtonProps & React.RefAttributes ) => { const { wallet, connected } = useWallet(); - const { onClick, children, ...rest } = props; + const { onClick, children, disabled, ...rest } = props; return ( - ); diff --git a/src/components/DepositInput/index.tsx b/src/components/DepositInput/index.tsx index d4c5a3c..4f5d6b2 100644 --- a/src/components/DepositInput/index.tsx +++ b/src/components/DepositInput/index.tsx @@ -7,7 +7,7 @@ import { } from "../../hooks"; import { LendingReserve } from "../../models/lending"; import { TokenIcon } from "../TokenIcon"; -import { Button, Card, Slider } from "antd"; +import { Card, Slider } from "antd"; import { NumericInput } from "../Input/numeric"; import { useConnection } from "../../contexts/connection"; import { useWallet } from "../../contexts/wallet"; @@ -16,6 +16,7 @@ import { PublicKey } from "@solana/web3.js"; import "./style.less"; import { ActionConfirmation } from "./../ActionConfirmation"; import { LABELS, marks } from "../../constants"; +import { ConnectButton } from "../ConnectButton"; export const DepositInput = (props: { className?: string; @@ -126,14 +127,14 @@ export const DepositInput = (props: { - + )} diff --git a/src/components/RepayInput/index.tsx b/src/components/RepayInput/index.tsx index f4bbb21..192679b 100644 --- a/src/components/RepayInput/index.tsx +++ b/src/components/RepayInput/index.tsx @@ -9,7 +9,7 @@ import { } from "../../hooks"; import { LendingReserve } from "../../models"; import { TokenIcon } from "../TokenIcon"; -import { Button, Card, Slider } from "antd"; +import { Card, Slider } from "antd"; import { ParsedAccount, useMint } from "../../contexts/accounts"; import { NumericInput } from "../Input/numeric"; import { useConnection } from "../../contexts/connection"; @@ -21,6 +21,7 @@ import { LABELS, marks } from "../../constants"; import { ActionConfirmation } from "./../ActionConfirmation"; import { fromLamports, wadToLamports } from "../../utils/utils"; import { notify } from "../../utils/notifications"; +import { ConnectButton } from "../ConnectButton"; export const RepayInput = (props: { className?: string; @@ -169,14 +170,14 @@ export const RepayInput = (props: { disabled={true} /> - + )} diff --git a/src/components/WithdrawInput/index.tsx b/src/components/WithdrawInput/index.tsx index 52a2664..869f438 100644 --- a/src/components/WithdrawInput/index.tsx +++ b/src/components/WithdrawInput/index.tsx @@ -8,7 +8,7 @@ import { } from "../../hooks"; import { LendingReserve } from "../../models/lending"; import { TokenIcon } from "../TokenIcon"; -import { Button, Card, Slider } from "antd"; +import { Card, Slider } from "antd"; import { NumericInput } from "../Input/numeric"; import { useConnection } from "../../contexts/connection"; import { useWallet } from "../../contexts/wallet"; @@ -17,6 +17,7 @@ import { PublicKey } from "@solana/web3.js"; import "./style.less"; import { LABELS, marks } from "../../constants"; import { ActionConfirmation } from "./../ActionConfirmation"; +import { ConnectButton } from "../ConnectButton"; export const WithdrawInput = (props: { className?: string; @@ -134,14 +135,14 @@ export const WithdrawInput = (props: { - + {fromAccounts.length === 0 ? LABELS.NO_DEPOSITS : LABELS.WITHDRAW_ACTION} + )} diff --git a/src/constants/labels.ts b/src/constants/labels.ts index 0d2db11..2246dfe 100644 --- a/src/constants/labels.ts +++ b/src/constants/labels.ts @@ -27,6 +27,7 @@ export const LABELS = { COLLATERAL: "Collateral", BORROW_QUESTION: "How much would you like to borrow?", BORROW_ACTION: "Borrow", + NO_DEPOSITS: "No collateral", LIQUIDATE_ACTION: "Liquidate", LIQUIDATE_NO_LOANS: "There are no loans to liquidate.", TABLE_TITLE_ASSET: "Asset",