mars-v2-frontend/src/pages/PortfolioAccountPage.tsx
Linkie Link 3c280518e8
Morph summary (#763)
* fix: fixed mobile issues with SVGs

* feat: first morphing AccountDetails

* tidy: composition refresh

* tidy: fine adjusting

* fix: svg fixes

* feat: updated summary structure

* feat: overall layout adjustments

* fix: fixed svg adjustments

* feat: finished AccountSummary update

* fix: fixed build

* tidy: refactor

* fix: fix enourmous APYs

* fix: don’t abbreviate APYs

* tidy: console.log

* fix: fix borrow Rate sorting

* fix: fixed scrollbars

* fix: hide scrollbars

* fix: resolved feedback

* fix: amount not size

* feat: only show credit account number outside of modals

* fix: added missing Strategies to PortfolioAccount

* fix: save some space
2024-02-06 10:05:42 +01:00

38 lines
1.4 KiB
TypeScript

import { useNavigate, useParams, useSearchParams } from 'react-router-dom'
import MigrationBanner from 'components/common/MigrationBanner'
import ShareBar from 'components/common/ShareBar'
import Balances from 'components/portfolio/Account/Balances'
import BreadCrumbs from 'components/portfolio/Account/BreadCrumbs'
import PerpPositions from 'components/portfolio/Account/PerpPositions'
import Strategies from 'components/portfolio/Account/Strategies'
import Summary from 'components/portfolio/Account/Summary'
import useAccountId from 'hooks/useAccountId'
import useChainConfig from 'hooks/useChainConfig'
import { getRoute } from 'utils/route'
export default function PortfolioAccountPage() {
const chainConfig = useChainConfig()
const selectedAccountId = useAccountId()
const { address, accountId } = useParams()
const navigate = useNavigate()
const [searchParams] = useSearchParams()
if (!accountId) {
navigate(getRoute('portfolio', searchParams, address, selectedAccountId))
return null
}
return (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
<BreadCrumbs accountId={accountId} />
<Summary accountId={accountId} />
<Balances accountId={accountId} />
{chainConfig.farm && <Strategies accountId={accountId} />}
{chainConfig.perps && <PerpPositions accountId={accountId} />}
<ShareBar text={`Have a look at Credit Account ${accountId} on @mars_protocol!`} />
</div>
)
}