From 09e886106bdd4475b663c58c2fd0d26a9b4b4523 Mon Sep 17 00:00:00 2001 From: borcherd Date: Mon, 4 Nov 2024 16:43:01 +0700 Subject: [PATCH] chore: Add state to account select --- .../src/components/common/Portfolio/lending-portfolio.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/marginfi-v2-ui/src/components/common/Portfolio/lending-portfolio.tsx b/apps/marginfi-v2-ui/src/components/common/Portfolio/lending-portfolio.tsx index 5804c009c..9c518ac13 100644 --- a/apps/marginfi-v2-ui/src/components/common/Portfolio/lending-portfolio.tsx +++ b/apps/marginfi-v2-ui/src/components/common/Portfolio/lending-portfolio.tsx @@ -31,6 +31,7 @@ export const LendingPortfolio = () => { const router = useRouter(); const { connected } = useWallet(); const [walletConnectionDelay, setWalletConnectionDelay] = React.useState(false); + const [isAccountSelectOpen, setIsAccountSelectOpen] = React.useState(false); const [setIsWalletOpen] = useWalletStore((state) => [state.setIsWalletOpen]); const [ @@ -62,6 +63,7 @@ export const LendingPortfolio = () => { const [rewardsDialogOpen, setRewardsDialogOpen] = React.useState(false); const [actionTxn, setActionTxn] = React.useState(null); const [rewardsLoading, setRewardsLoading] = React.useState(false); + const { handleSimulation, bankAddressesWithEmissions } = useRewardSimulation({ simulationResult: rewards, actionTxn, @@ -236,6 +238,11 @@ export const LendingPortfolio = () => { handleSwitchAccount(new PublicKey(value)); }} disabled={isSwitchingAccount} + open={isAccountSelectOpen} + onOpenChange={(open) => { + setIsAccountSelectOpen(open); + }} + value={selectedAccount?.address.toBase58()} > Account{" "} @@ -252,6 +259,7 @@ export const LendingPortfolio = () => {