Skip to content

Commit

Permalink
fix(mfi-v2-ui): changed bankcap name
Browse files Browse the repository at this point in the history
  • Loading branch information
k0beLeenders committed Sep 10, 2023
1 parent 57e68c9 commit 7000d94
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ type Props = {
bank: ExtendedBankInfo;
nativeSolBalance: number;
isInLendingMode: boolean;
bankCap: number;
bankFilledPercentage: number;
};

export function PoolCardStats({ bank, isInLendingMode, nativeSolBalance, bankCap }: Props) {
export function PoolCardStats({ bank, isInLendingMode, nativeSolBalance, bankFilledPercentage }: Props) {
const assetWeight = useMemo(() => {
if (bank.info.rawBank.config.assetWeightInit.toNumber() <= 0) {
return "-";
Expand Down Expand Up @@ -43,9 +43,9 @@ export function PoolCardStats({ bank, isInLendingMode, nativeSolBalance, bankCap
[bank, nativeSolBalance]
);

const isFilled = useMemo(() => bankCap >= 0.9999, [bankCap]);
const isFilled = useMemo(() => bankFilledPercentage >= 0.9999, [bankFilledPercentage]);

const isHigh = useMemo(() => bankCap >= 0.9, [bankCap]);
const isHigh = useMemo(() => bankFilledPercentage >= 0.9, [bankFilledPercentage]);

return (
<View style={tw`flex flex-row`}>
Expand All @@ -57,7 +57,11 @@ export function PoolCardStats({ bank, isInLendingMode, nativeSolBalance, bankCap
<View style={tw`flex flex-col min-w-77px`}>
<Text style={tw`font-normal text-sm text-tertiary`}>{isInLendingMode ? "Deposits" : "Available"}</Text>
<Text style={tw`font-medium text-base text-primary`}>{bankAmount}</Text>
{isHigh && <Text style={tw`text-${isFilled ? "error" : "warning"}`}>{percentFormatter.format(bankCap)}</Text>}
{isHigh && (
<Text style={tw`text-${isFilled ? "error" : "warning"}`}>
{percentFormatter.format(bankFilledPercentage)}
</Text>
)}
</View>
<Separator style={tw`mx-12px`} />
<View style={tw`flex flex-col min-w-77px`}>
Expand Down

0 comments on commit 7000d94

Please sign in to comment.