Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(mfi-v2-ui): Add state to account selector on portfolio #942

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading