Skip to content

Commit

Permalink
Only show AccountSubnavigation in account details
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed May 21, 2024
1 parent a6a2bd9 commit f30c919
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
1 change: 1 addition & 0 deletions .changelog/1946.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only show Delegations and Debonding tabs in account details
20 changes: 12 additions & 8 deletions src/app/pages/AccountPage/Features/AccountDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@ import { useSelector } from 'react-redux'
import { SendTransaction } from '../SendTransaction'
import { TransactionHistory } from '../TransactionHistory'
import { selectIsAddressInWallet } from 'app/state/selectIsAddressInWallet'
import { AccountSubnavigation } from '../AccountSubnavigation'

interface Props {}

export const AccountDetails = memo((props: Props) => {
const isAddressInWallet = useSelector(selectIsAddressInWallet)

return (
<Box direction="row" wrap style={{ gap: '24px' }}>
{isAddressInWallet && (
<Box flex={{ grow: 1 }} basis="32ex" width={{ max: '100%' }}>
<SendTransaction isAddressInWallet={isAddressInWallet} />
<>
<AccountSubnavigation />
<Box direction="row" wrap style={{ gap: '24px' }}>
{isAddressInWallet && (
<Box flex={{ grow: 1 }} basis="32ex" width={{ max: '100%' }}>
<SendTransaction isAddressInWallet={isAddressInWallet} />
</Box>
)}
<Box flex={{ grow: 3 }} basis="80ex" width={{ max: '100%' }}>
<TransactionHistory />
</Box>
)}
<Box flex={{ grow: 3 }} basis="80ex" width={{ max: '100%' }}>
<TransactionHistory />
</Box>
</Box>
</>
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function AccountSubnavigation() {
? t('account.subnavigation.mobileActiveDelegations', 'Delegations')
: t('account.subnavigation.activeDelegations', 'Active delegations')
}
route="active-delegations"
route={`/account/${address}/active-delegations`}
/>

<NavItem
Expand All @@ -80,7 +80,7 @@ export function AccountSubnavigation() {
? t('account.subnavigation.mobileDebondingDelegations', 'Debonding')
: t('account.subnavigation.debondingDelegations', 'Debonding delegations')
}
route="debonding-delegations"
route={`/account/${address}/debonding-delegations`}
/>
</Nav>
)
Expand Down
2 changes: 0 additions & 2 deletions src/app/pages/AccountPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { selectActiveWallet, selectHasAccounts, selectHasOneAccount } from 'app/
import { walletActions } from 'app/state/wallet'
import { AccountSummary } from './Features/AccountSummary'
import { AccountPageParams } from './validateAccountPageRoute'
import { AccountSubnavigation } from './Features/AccountSubnavigation'

interface AccountPageProps {}

Expand Down Expand Up @@ -108,7 +107,6 @@ export function AccountPage(props: AccountPageProps) {
walletHasAccounts={walletHasAccounts}
/>
<Box margin={{ bottom: 'small' }}></Box>
<AccountSubnavigation />
<Outlet />
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'

import { DelegationList } from '.'
import { AccountSubnavigation } from '../../../AccountPage/Features/AccountSubnavigation'

export const ActiveDelegationList = () => {
const { t } = useTranslation()
const delegations = useSelector(selectActiveDelegations)
return (
<Box pad="medium" background="background-front">
<Header>{t('delegations.activeDelegations', 'Active delegations')}</Header>
<DelegationList type="active" delegations={delegations ?? []} />
</Box>
<>
<AccountSubnavigation />
<Box pad="medium" background="background-front">
<Header level={2}>{t('delegations.activeDelegations', 'Active delegations')}</Header>
<DelegationList type="active" delegations={delegations ?? []} />
</Box>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'

import { DelegationList } from '.'
import { AccountSubnavigation } from '../../../AccountPage/Features/AccountSubnavigation'

export const DebondingDelegationList = () => {
const { t } = useTranslation()
const delegations = useSelector(selectDebondingDelegations)
return (
<Box pad="medium" background="background-front">
<Header>{t('delegations.debondingDelegations', 'Debonding delegations')}</Header>
<DelegationList type="debonding" delegations={delegations ?? []} />
</Box>
<>
<AccountSubnavigation />
<Box pad="medium" background="background-front">
<Header level={2}>{t('delegations.debondingDelegations', 'Debonding delegations')}</Header>
<DelegationList type="debonding" delegations={delegations ?? []} />
</Box>
</>
)
}

0 comments on commit f30c919

Please sign in to comment.