Skip to content

Commit 5b47d5e

Browse files
committed
fix: hide mobile nav after selecting Vault Info
1 parent 4fd83ac commit 5b47d5e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/components/account/AccountList/AccountStats.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export default function AccountStats(props: Props) {
8888
const navigateToVaultDetails = useCallback(() => {
8989
if (!account) return
9090
setShowMenu?.(false)
91+
useStore.setState({ mobileNavExpanded: false })
9192
const vaultAddress =
9293
typeof account.kind === 'object' && 'fund_manager' in account.kind
9394
? account.kind.fund_manager.vault_addr

src/components/account/AccountList/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ export default function AccountList(props: Props) {
7777
contentClassName='bg-surface group-hover/account:bg-surface'
7878
onClick={() => {
7979
if (isActive) return
80-
if (isMobile) setShowMenu(false)
80+
if (isMobile) {
81+
setShowMenu(false)
82+
useStore.setState({ mobileNavExpanded: false })
83+
}
8184
useStore.setState({ accountDeleteModal: null })
8285

8386
navigate(

src/components/portfolio/Card/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { NavLink, useParams, useSearchParams } from 'react-router-dom'
44

55
import { FormattedNumber } from 'components/common/FormattedNumber'
66
import Loading from 'components/common/Loading'
7+
import VaultDetails from 'components/managedVaults/vaultDetails'
78
import Skeleton from 'components/portfolio/Card/Skeleton'
89
import { getDefaultChainSettings } from 'constants/defaultSettings'
910
import { LocalStorageKeys } from 'constants/localStorageKeys'
@@ -17,7 +18,6 @@ import useLocalStorage from 'hooks/localStorage/useLocalStorage'
1718
import useStore from 'store'
1819
import { checkAccountKind } from 'utils/accounts'
1920
import { getRoute } from 'utils/route'
20-
import VaultDetails from 'components/managedVaults/vaultDetails'
2121

2222
interface Props {
2323
accountId: string
@@ -82,6 +82,7 @@ export default function PortfolioCard(props: Props) {
8282
if (isVault && vaultAddress) {
8383
e.preventDefault()
8484
useStore.setState({
85+
mobileNavExpanded: false,
8586
focusComponent: {
8687
component: <VaultDetails vaultAddress={vaultAddress} />,
8788
onClose: () => {

0 commit comments

Comments
 (0)