forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wallet-ext] pull real Ledger addresses and display them in the "Impo…
…rt Accounts" UI (MystenLabs#9117) ## Description This PR updates the "Import Accounts" UI to pull and display real addresses from a user's Ledger device. With all accounts already imported: <video src="https://user-images.githubusercontent.com/7453188/224426690-693f5ee5-bfa4-4f85-90e5-86159db77c4c.mov"> With many accounts to import: <video src="https://user-images.githubusercontent.com/7453188/224426794-5b87f263-692e-4c2c-8854-489df30619ef.mov"> With few accounts to import: <img width="411" alt="image" src="https://user-images.githubusercontent.com/7453188/224427040-0239af4a-76ac-49bf-9a98-16e1dab4f290.png"> ## Test Plan - Manual testing - Verified addresses are valid Sui addresses that can receive money - Tested a variety of error cases where the Ledger doesn't have the Sui application open --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
- Loading branch information
1 parent
70f56d9
commit c79a5b4
Showing
5 changed files
with
257 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
apps/wallet/src/ui/app/components/ledger/LedgerAccountList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { LedgerAccountItem, type LedgerAccount } from './LedgerAccountItem'; | ||
|
||
type LedgerAccountListProps = { | ||
accounts: LedgerAccount[]; | ||
onAccountClick: (account: LedgerAccount) => void; | ||
}; | ||
|
||
export function LedgerAccountList({ | ||
accounts, | ||
onAccountClick, | ||
}: LedgerAccountListProps) { | ||
return ( | ||
<ul className="list-none m-0 p-0"> | ||
{accounts.map((account) => ( | ||
<li className="pt-2 pb-2 first:pt-1" key={account.address}> | ||
<button | ||
className="w-full appearance-none border-0 p-0 bg-transparent cursor-pointer" | ||
onClick={() => { | ||
onAccountClick(account); | ||
}} | ||
> | ||
<LedgerAccountItem | ||
isSelected={account.isSelected} | ||
address={account.address} | ||
/> | ||
</button> | ||
</li> | ||
))} | ||
</ul> | ||
); | ||
} |
Oops, something went wrong.