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: account settings view support multiple accounts (MystenLa…
…bs#8297) * display all the accounts of the user * update the ui <img width="378" alt="Screenshot 2023-02-15 at 18 17 26" src="https://user-images.githubusercontent.com/10210143/219118244-88e75c3b-d10a-4687-90df-fe28cd4bf100.png"> https://user-images.githubusercontent.com/10210143/219118290-e619926e-1928-4c38-a09b-a4c4c4b53f53.mov closes APPS-286
- Loading branch information
1 parent
b6be236
commit 77bcada
Showing
7 changed files
with
60 additions
and
21 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
apps/wallet/src/ui/app/components/menu/content/Account.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,38 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Copy16 } from '@mysten/icons'; | ||
|
||
import { useMiddleEllipsis } from '_src/ui/app/hooks'; | ||
import { useCopyToClipboard } from '_src/ui/app/hooks/useCopyToClipboard'; | ||
import { Heading } from '_src/ui/app/shared/heading'; | ||
|
||
export type AccountProps = { | ||
address: string; | ||
}; | ||
|
||
export function Account({ address }: AccountProps) { | ||
const addressShort = useMiddleEllipsis(address); | ||
const copyCallback = useCopyToClipboard(address, { | ||
copySuccessMessage: 'Address copied', | ||
}); | ||
return ( | ||
<div className="flex flex-nowrap items-center border border-solid border-gray-60 rounded-lg p-5"> | ||
<div className="flex-1"> | ||
<Heading | ||
mono | ||
weight="semibold" | ||
variant="heading6" | ||
color="steel-dark" | ||
leading="none" | ||
> | ||
{addressShort} | ||
</Heading> | ||
</div> | ||
<Copy16 | ||
onClick={copyCallback} | ||
className="transition text-base leading-none text-gray-60 active:text-gray-60 hover:text-hero-darkest cursor-pointer p1" | ||
/> | ||
</div> | ||
); | ||
} |
17 changes: 6 additions & 11 deletions
17
apps/wallet/src/ui/app/components/menu/content/AccountsSettings.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
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
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