@@ -209,8 +210,8 @@ export function PositionsSummaryTable({
|
@@ -218,11 +219,13 @@ export function PositionsSummaryTable({
|
- {formatReadable(position.totalSupply)}
- {position.loanAsset}
+
+ {formatReadable(groupedPosition.totalSupply)}
+
+ {groupedPosition.loanAsset}
@@ -233,12 +236,12 @@ export function PositionsSummaryTable({
|
- {position.collaterals.length > 0 ? (
- position.collaterals.map((collateral, index) => (
+ {groupedPosition.collaterals.length > 0 ? (
+ groupedPosition.collaterals.map((collateral, index) => (
@@ -251,15 +254,15 @@ export function PositionsSummaryTable({
@@ -270,7 +273,7 @@ export function PositionsSummaryTable({
type="button"
className="bg-hovered rounded-sm bg-opacity-50 p-2 text-xs duration-300 ease-in-out hover:bg-primary"
onClick={() => {
- setSelectedGroupedPosition(position);
+ setSelectedGroupedPosition(groupedPosition);
setShowRebalanceModal(true);
}}
>
@@ -279,18 +282,28 @@ export function PositionsSummaryTable({
|
- {isExpanded && (
-
- |
-
- |
-
- )}
+
+ {expandedRows.has(rowKey) && (
+
+ |
+
+
+
+ |
+
+ )}
+
);
})}
diff --git a/app/positions/components/RebalanceActionInput.tsx b/app/positions/components/RebalanceActionInput.tsx
index 05f646ca..aeb189c1 100644
--- a/app/positions/components/RebalanceActionInput.tsx
+++ b/app/positions/components/RebalanceActionInput.tsx
@@ -28,7 +28,7 @@ export function RebalanceActionInput({
onAddAction,
}: RebalanceActionInputProps) {
return (
-
+
Rebalance
diff --git a/app/positions/components/RebalanceModal.tsx b/app/positions/components/RebalanceModal.tsx
index c9b37795..808e3ce1 100644
--- a/app/positions/components/RebalanceModal.tsx
+++ b/app/positions/components/RebalanceModal.tsx
@@ -357,7 +357,7 @@ export function RebalanceModal({
onPress={() => void handleExecuteRebalance()}
isDisabled={isConfirming || rebalanceActions.length === 0}
isLoading={isConfirming}
- className="rounded-sm bg-orange-500 p-4 px-10 font-zen text-white opacity-80 transition-all duration-200 ease-in-out hover:scale-105 hover:opacity-100 disabled:opacity-50 dark:bg-orange-600"
+ className="rounded-sm bg-primary p-4 px-10 font-zen text-white opacity-80 transition-all duration-200 ease-in-out hover:scale-105 hover:opacity-100 disabled:opacity-50 dark:bg-primary"
>
{needSwitchChain ? 'Switch Network & Execute' : 'Execute Rebalance'}
diff --git a/app/positions/components/SuppliedMarketsDetail.tsx b/app/positions/components/SuppliedMarketsDetail.tsx
index d9fc917c..580a6271 100644
--- a/app/positions/components/SuppliedMarketsDetail.tsx
+++ b/app/positions/components/SuppliedMarketsDetail.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import { Tooltip } from '@nextui-org/tooltip';
+import { motion } from 'framer-motion';
import Link from 'next/link';
import { IoWarningOutline } from 'react-icons/io5';
import OracleVendorBadge from '@/components/OracleVendorBadge';
@@ -57,164 +58,174 @@ export function SuppliedMarketsDetail({
};
return (
-
-
-
- Collateral Exposure
-
- {groupedPosition.processedCollaterals.map((collateral, colIndex) => (
-
- ))}
-
-
- {groupedPosition.processedCollaterals.map((collateral, colIndex) => (
-
-
+
+
+
+ Collateral Exposure
+
+ {groupedPosition.processedCollaterals.map((collateral, colIndex) => (
+
- ■
- {' '}
- {collateral.symbol}: {formatReadable(collateral.percentage)}%
-
- ))}
+ title={`${collateral.symbol}: ${collateral.percentage.toFixed(2)}%`}
+ />
+ ))}
+
+
+ {groupedPosition.processedCollaterals.map((collateral, colIndex) => (
+
+
+ ■
+ {' '}
+ {collateral.symbol}: {formatReadable(collateral.percentage)}%
+
+ ))}
+
-
-
-
-
- | Market |
- Collateral |
- Oracle |
- LLTV |
- APY |
- Supplied |
- % of Portfolio |
- Actions |
-
-
-
- {sortedMarkets.map((position) => {
- const suppliedAmount = Number(
- formatBalance(position.supplyAssets, position.market.loanAsset.decimals),
- );
- const percentageOfPortfolio =
- totalSupply > 0 ? (suppliedAmount / totalSupply) * 100 : 0;
- const warningColor = getWarningColor(position.market.warningsWithDetail);
+
+
+
+ | Market |
+ Collateral |
+ Oracle |
+ LLTV |
+ APY |
+ Supplied |
+ % of Portfolio |
+ Actions |
+
+
+
+ {sortedMarkets.map((position) => {
+ const suppliedAmount = Number(
+ formatBalance(position.supplyAssets, position.market.loanAsset.decimals),
+ );
+ const percentageOfPortfolio =
+ totalSupply > 0 ? (suppliedAmount / totalSupply) * 100 : 0;
+ const warningColor = getWarningColor(position.market.warningsWithDetail);
- return (
-
-
-
-
- {position.market.warningsWithDetail.length > 0 ? (
- }
- placement="top"
- >
-
-
-
-
- ) : (
-
- )}
+ return (
+
+
+
+
+ {position.market.warningsWithDetail.length > 0 ? (
+
+ }
+ placement="top"
+ >
+
+
+
+
+ ) : (
+
+ )}
+
+ {/* */}
+
+ {position.market.uniqueKey.slice(2, 8)}
+
+ {/* */}
- {/* */}
-
- {position.market.uniqueKey.slice(2, 8)}
-
- {/* */}
-
- |
-
- {position.market.collateralAsset ? (
-
-
- {position.market.collateralAsset.symbol}
+ |
+
+ {position.market.collateralAsset ? (
+
+
+ {position.market.collateralAsset.symbol}
+
+ ) : (
+ 'N/A'
+ )}
+ |
+
+
+
- ) : (
- 'N/A'
- )}
- |
-
-
-
-
- |
-
- {formatBalance(position.market.lltv, 16)}%
- |
-
- {formatReadable(position.market.dailyApys.netSupplyApy * 100)}%
- |
-
- {formatReadable(suppliedAmount)} {position.market.loanAsset.symbol}
- |
-
- |
+
+ {formatBalance(position.market.lltv, 16)}%
+ |
+
+ {formatReadable(position.market.dailyApys.netSupplyApy * 100)}%
+ |
+
+ {formatReadable(suppliedAmount)} {position.market.loanAsset.symbol}
+ |
+
+
+
+
+ {formatReadable(percentageOfPortfolio)}%
+
-
- {formatReadable(percentageOfPortfolio)}%
-
-
- |
-
-
-
- |
-
- );
- })}
- |
-
-
+
+
+
+
+ |
+
+ );
+ })}
+
+
+
+
);
}
diff --git a/app/settings/faq/page.tsx b/app/settings/faq/page.tsx
new file mode 100644
index 00000000..bedae538
--- /dev/null
+++ b/app/settings/faq/page.tsx
@@ -0,0 +1,56 @@
+'use client';
+
+import Link from 'next/link';
+
+function FAQPage() {
+ const faqs = [
+ {
+ question: 'Where can I find the source code?',
+ answer: (
+
+ The source code is available on{' '}
+
+ GitHub
+
+ .
+
+ ),
+ },
+ {
+ question: 'Where can I get help?',
+ answer: (
+
+ Join our{' '}
+
+ Telegram chat
+ {' '}
+ for support and discussions.
+
+ ),
+ },
+ ];
+
+ return (
+
+ Frequently Asked Questions
+
+ {faqs.map((faq, index) => (
+
+ {faq.question}
+ {faq.answer}
+
+ ))}
+
+
+ );
+}
+
+export default FAQPage;
diff --git a/src/components/common/PrimaryButton.tsx b/src/components/common/PrimaryButton.tsx
index eda456cd..0645c88e 100644
--- a/src/components/common/PrimaryButton.tsx
+++ b/src/components/common/PrimaryButton.tsx
@@ -19,7 +19,7 @@ export default function PrimaryButton({
type="button"
className={`${
isSecondary ? 'bg-surface' : 'bg-monarch-orange'
- } rounded-sm p-4 px-10 font-zen opacity-80 transition-all duration-200 ease-in-out hover:opacity-100 ${className} hover:scale-105`}
+ } rounded-sm p-4 px-10 font-zen opacity-90 transition-all duration-200 ease-in-out hover:opacity-100 ${className} hover:scale-105`}
>
{children}
diff --git a/src/components/layout/header/AccountConnect.tsx b/src/components/layout/header/AccountConnect.tsx
index f4cdce15..d6ac5d93 100644
--- a/src/components/layout/header/AccountConnect.tsx
+++ b/src/components/layout/header/AccountConnect.tsx
@@ -1,7 +1,6 @@
import { ConnectButton } from '@rainbow-me/rainbowkit';
import '@rainbow-me/rainbowkit/styles.css';
import { AccountDropdown } from './AccountDropdown';
-import { AccountInfoPanel } from './AccountInfoPanel';
/**
* AccountConnect
@@ -46,14 +45,9 @@ function AccountConnect() {
}
return (
- <>
-
-
- >
+
);
})()}
diff --git a/src/components/layout/header/AccountDropdown.tsx b/src/components/layout/header/AccountDropdown.tsx
index 8d955693..a03f952f 100644
--- a/src/components/layout/header/AccountDropdown.tsx
+++ b/src/components/layout/header/AccountDropdown.tsx
@@ -1,27 +1,42 @@
+import { useCallback, useState } from 'react';
+import { Name } from '@coinbase/onchainkit/identity';
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
+import { ExitIcon, ExternalLinkIcon } from '@radix-ui/react-icons';
import { clsx } from 'clsx';
-import { useAccount } from 'wagmi';
+import Link from 'next/link';
+import { usePathname } from 'next/navigation';
+import { FiSettings } from 'react-icons/fi';
+import { useAccount, useDisconnect } from 'wagmi';
import { Avatar } from '@/components/Avatar/Avatar';
-import { AccountInfoPanel } from './AccountInfoPanel';
+import { getSlicedAddress } from '@/utils/address';
+import { getExplorerURL } from '@/utils/external';
const DropdownMenuContentStyle = {
marginTop: '-22px',
};
export function AccountDropdown() {
- const { address } = useAccount();
+ const { address, chainId } = useAccount();
+ const { disconnect } = useDisconnect();
+ const pathname = usePathname();
+ const [isOpen, setIsOpen] = useState(false);
+
+ const handleDisconnectWallet = useCallback(() => {
+ disconnect();
+ }, [disconnect]);
+
+ if (!address) return null;
return (
-
+
-
- {address && (
-
- )}
+
+
-
+
+
+
+
+
+
+
+ {getSlicedAddress(address)}
+
+
+
+
+
+
+
+
+
+
+ Settings
+
+
+
+
diff --git a/src/components/layout/header/AccountInfoPanel.tsx b/src/components/layout/header/AccountInfoPanel.tsx
deleted file mode 100644
index f25f94d3..00000000
--- a/src/components/layout/header/AccountInfoPanel.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import { useCallback } from 'react';
-import { Name } from '@coinbase/onchainkit/identity';
-import { ExitIcon, ExternalLinkIcon } from '@radix-ui/react-icons';
-import { clsx } from 'clsx';
-import Link from 'next/link';
-import { usePathname } from 'next/navigation';
-import { FiSettings } from 'react-icons/fi';
-import { useAccount, useDisconnect } from 'wagmi';
-import { Avatar } from '@/components/Avatar/Avatar';
-import { getSlicedAddress } from '@/utils/address';
-import { getExplorerURL } from '@/utils/external';
-
-export function AccountInfoPanel() {
- const { address, chainId } = useAccount();
- const { disconnect } = useDisconnect();
- const pathname = usePathname();
-
- const handleDisconnectWallet = useCallback(() => {
- disconnect();
- }, [disconnect]);
-
- if (!address) return null;
-
- return (
- <>
-
-
-
-
-
-
-
- {getSlicedAddress(address)}
-
-
-
-
-
-
-
-
- Settings
-
-
-
- >
- );
-}
diff --git a/src/components/layout/header/Navbar.tsx b/src/components/layout/header/Navbar.tsx
index c8e8983e..efb7c7c4 100644
--- a/src/components/layout/header/Navbar.tsx
+++ b/src/components/layout/header/Navbar.tsx
@@ -1,13 +1,11 @@
'use client';
-import { useState } from 'react';
import { clsx } from 'clsx';
import Image from 'next/image';
import NextLink from 'next/link';
import { usePathname } from 'next/navigation';
import { useTheme } from 'next-themes';
import { FaRegMoon, FaSun } from 'react-icons/fa';
-import { RiMenu3Line, RiCloseLine } from 'react-icons/ri';
import { useAccount } from 'wagmi';
import logo from '../../imgs/logo.png';
import AccountConnect from './AccountConnect';
@@ -26,15 +24,16 @@ export function NavbarLink({
matchKey?: string;
}) {
const pathname = usePathname();
- const isActive = pathname.includes(matchKey ?? href);
+ const isActive = matchKey === '/' ? pathname === matchKey : pathname.includes(matchKey ?? href);
return (
+ |