From dd5589a6631eb909db5f7894a9ec61ac027579e9 Mon Sep 17 00:00:00 2001 From: "nature.xie" Date: Fri, 22 Dec 2023 22:49:16 +0800 Subject: [PATCH] repay modal ui --- components/Modal/components.tsx | 16 +++++++++++----- components/Modal/index.tsx | 7 ++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/components/Modal/components.tsx b/components/Modal/components.tsx index 8b9bc9b4..d1e1f5ef 100644 --- a/components/Modal/components.tsx +++ b/components/Modal/components.tsx @@ -70,11 +70,8 @@ export const CloseButton = ({ onClose, ...props }) => ( ); -export const TokenInfo = ({ apy, asset, onClose }) => { - const { action, symbol, tokenId, icon, depositRewards, borrowRewards } = asset; - const page = ["Withdraw", "Adjust", "Supply"].includes(action) ? "deposit" : "borrow"; - const isRepay = action === "Repay"; - const { degenMode, isRepayFromDeposits, setRepayFromDeposits } = useDegenMode(); +export const ModalTitle = ({ asset, onClose }) => { + const { action, symbol } = asset; return (
@@ -83,6 +80,15 @@ export const TokenInfo = ({ apy, asset, onClose }) => {
+ + ); +}; +export const RepayTab = ({ asset }) => { + const { action } = asset; + const isRepay = action === "Repay"; + const { degenMode, isRepayFromDeposits, setRepayFromDeposits } = useDegenMode(); + return ( +
{isRepay && degenMode.enabled && (
{ > {!accountId && } - + {action === "Borrow" || action === "Repay" ? ( { setSelectedCollateralType={setSelectedCollateralType} /> ) : null} - +