Skip to content

Commit

Permalink
wallet-ext: approve dapp connection hide (de)select all when one account
Browse files Browse the repository at this point in the history
  • Loading branch information
pchrysochoidis committed Oct 6, 2023
1 parent ae00dfb commit 973676f
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions apps/wallet/src/ui/app/components/accounts/AccountMultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,26 @@ export function AccountMultiSelectWithControls({
onChange={onChange}
/>

<Button
onClick={() => {
if (selectedAccountIds.length < accounts.length) {
// select all accounts if not all are selected
onChange(accounts.map((account) => account.id));
} else {
// deselect all accounts
onChange([]);
{accounts.length > 1 ? (
<Button
onClick={() => {
if (selectedAccountIds.length < accounts.length) {
// select all accounts if not all are selected
onChange(accounts.map((account) => account.id));
} else {
// deselect all accounts
onChange([]);
}
}}
variant="outline"
size="xs"
text={
selectedAccountIds.length < accounts.length
? 'Select All Accounts'
: 'Deselect All Accounts'
}
}}
variant="outline"
size="xs"
text={
selectedAccountIds.length < accounts.length
? 'Select All Accounts'
: 'Deselect All Accounts'
}
/>
/>
) : null}
</div>
);
}

0 comments on commit 973676f

Please sign in to comment.