mirror of https://github.com/certusone/oyster.git
lint
This commit is contained in:
parent
805faf8b36
commit
51ad245011
|
@ -1,21 +1,26 @@
|
||||||
import {Slider} from "antd";
|
import { Slider } from "antd";
|
||||||
import Card from "antd/lib/card";
|
import Card from "antd/lib/card";
|
||||||
import React, {useCallback, useEffect} from "react";
|
import React, { useCallback, useEffect } from "react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import {LABELS, marks} from "../../constants";
|
import { LABELS, marks } from "../../constants";
|
||||||
import {ParsedAccount, useMint} from "../../contexts/accounts";
|
import { ParsedAccount, useMint } from "../../contexts/accounts";
|
||||||
import {EnrichedLendingObligation, InputType, useSliderInput, useUserBalance} from "../../hooks";
|
import {
|
||||||
|
EnrichedLendingObligation,
|
||||||
|
InputType,
|
||||||
|
useSliderInput,
|
||||||
|
useUserBalance,
|
||||||
|
} from "../../hooks";
|
||||||
import { LendingReserve } from "../../models";
|
import { LendingReserve } from "../../models";
|
||||||
import { ActionConfirmation } from "../ActionConfirmation";
|
import { ActionConfirmation } from "../ActionConfirmation";
|
||||||
import { liquidate } from "../../actions";
|
import { liquidate } from "../../actions";
|
||||||
import "./style.less";
|
import "./style.less";
|
||||||
import { useConnection } from "../../contexts/connection";
|
import { useConnection } from "../../contexts/connection";
|
||||||
import { useWallet } from "../../contexts/wallet";
|
import { useWallet } from "../../contexts/wallet";
|
||||||
import {fromLamports, wadToLamports} from "../../utils/utils";
|
import { fromLamports, wadToLamports } from "../../utils/utils";
|
||||||
import CollateralInput from "../CollateralInput";
|
import CollateralInput from "../CollateralInput";
|
||||||
import {notify} from "../../utils/notifications";
|
import { notify } from "../../utils/notifications";
|
||||||
import {ConnectButton} from "../ConnectButton";
|
import { ConnectButton } from "../ConnectButton";
|
||||||
import {useMidPriceInUSD} from "../../contexts/market";
|
import { useMidPriceInUSD } from "../../contexts/market";
|
||||||
|
|
||||||
export const LiquidateInput = (props: {
|
export const LiquidateInput = (props: {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
@ -56,7 +61,6 @@ export const LiquidateInput = (props: {
|
||||||
|
|
||||||
const { value, setValue, pct, setPct, type } = useSliderInput(convert);
|
const { value, setValue, pct, setPct, type } = useSliderInput(convert);
|
||||||
|
|
||||||
|
|
||||||
const onLiquidate = useCallback(() => {
|
const onLiquidate = useCallback(() => {
|
||||||
if (!withdrawReserve) {
|
if (!withdrawReserve) {
|
||||||
return;
|
return;
|
||||||
|
@ -86,7 +90,7 @@ export const LiquidateInput = (props: {
|
||||||
setValue("");
|
setValue("");
|
||||||
setCollateralValue("");
|
setCollateralValue("");
|
||||||
setShowConfirmation(true);
|
setShowConfirmation(true);
|
||||||
} catch (error){
|
} catch (error) {
|
||||||
// TODO:
|
// TODO:
|
||||||
notify({
|
notify({
|
||||||
message: "Unable to liquidate loan.",
|
message: "Unable to liquidate loan.",
|
||||||
|
@ -110,7 +114,7 @@ export const LiquidateInput = (props: {
|
||||||
borrowAmountLamports,
|
borrowAmountLamports,
|
||||||
pct,
|
pct,
|
||||||
tokenBalance,
|
tokenBalance,
|
||||||
type
|
type,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const collateralPrice = useMidPriceInUSD(
|
const collateralPrice = useMidPriceInUSD(
|
||||||
|
|
Loading…
Reference in New Issue