tidy: refactor
This commit is contained in:
parent
11dac403a0
commit
7cfe05ebb7
@ -77,7 +77,8 @@ export default function AccountSummary(props: Props) {
|
|||||||
[accountSummaryTabs, setAccountSummaryTabs],
|
[accountSummaryTabs, setAccountSummaryTabs],
|
||||||
)
|
)
|
||||||
|
|
||||||
const items = [
|
const items = useMemo(() => {
|
||||||
|
const itemsArray = [
|
||||||
{
|
{
|
||||||
title: `Credit Account ${props.account.id} Composition`,
|
title: `Credit Account ${props.account.id} Composition`,
|
||||||
renderContent: () =>
|
renderContent: () =>
|
||||||
@ -103,9 +104,8 @@ export default function AccountSummary(props: Props) {
|
|||||||
renderSubTitle: () => <></>,
|
renderSubTitle: () => <></>,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
if (chainConfig.perps)
|
if (chainConfig.perps)
|
||||||
items.push({
|
itemsArray.push({
|
||||||
title: 'Perp Positions',
|
title: 'Perp Positions',
|
||||||
renderContent: () =>
|
renderContent: () =>
|
||||||
props.account && props.account.perps.length > 0 ? (
|
props.account && props.account.perps.length > 0 ? (
|
||||||
@ -116,6 +116,17 @@ export default function AccountSummary(props: Props) {
|
|||||||
renderSubTitle: () => <></>,
|
renderSubTitle: () => <></>,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return itemsArray
|
||||||
|
}, [
|
||||||
|
props.account,
|
||||||
|
borrowAssetsData,
|
||||||
|
lendingAssetsData,
|
||||||
|
props.isHls,
|
||||||
|
chainConfig.perps,
|
||||||
|
handleToggle,
|
||||||
|
accountSummaryTabs,
|
||||||
|
])
|
||||||
|
|
||||||
if (!props.account) return null
|
if (!props.account) return null
|
||||||
return (
|
return (
|
||||||
<div className='h-[546px] max-w-screen overflow-y-scroll scrollbar-hide w-93.5'>
|
<div className='h-[546px] max-w-screen overflow-y-scroll scrollbar-hide w-93.5'>
|
||||||
|
Loading…
Reference in New Issue
Block a user