Skip to content

Commit

Permalink
Merge pull request #942 from mrgnlabs/chore/account-select-changes
Browse files Browse the repository at this point in the history
chore(mfi-v2-ui): Add state to account selector on portfolio
  • Loading branch information
k0beLeenders authored Nov 4, 2024
2 parents 2f93090 + 09e8861 commit 00b69d8
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down Expand Up @@ -62,6 +63,7 @@ export const LendingPortfolio = () => {
const [rewardsDialogOpen, setRewardsDialogOpen] = React.useState(false);
const [actionTxn, setActionTxn] = React.useState<VersionedTransaction | null>(null);
const [rewardsLoading, setRewardsLoading] = React.useState(false);

const { handleSimulation, bankAddressesWithEmissions } = useRewardSimulation({
simulationResult: rewards,
actionTxn,
Expand Down Expand Up @@ -236,6 +238,11 @@ export const LendingPortfolio = () => {
handleSwitchAccount(new PublicKey(value));
}}
disabled={isSwitchingAccount}
open={isAccountSelectOpen}
onOpenChange={(open) => {
setIsAccountSelectOpen(open);
}}
value={selectedAccount?.address.toBase58()}
>
<SelectTrigger className="w-max">
Account{" "}
Expand All @@ -252,6 +259,7 @@ export const LendingPortfolio = () => {
<Button
onClick={() => {
setIsWalletOpen(true);
setIsAccountSelectOpen(false);
}}
className="flex items-center mt-1 w-full font-light h-[32px] py-1.5 pl-2 pr-8 text-sm cursor-pointer hover:bg-background-gray-dark hover:text-primary"
variant="outline"
Expand Down

0 comments on commit 00b69d8

Please sign in to comment.