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

wallet-ext: approve dapp connection hide (de)select all when one account #14138

Merged
merged 1 commit into from
Oct 10, 2023
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
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>
);
}
Loading