diff --git a/packages/page-accounts/src/Sidebar/AddressSection.tsx b/packages/page-accounts/src/Sidebar/AddressSection.tsx index 18506b495f..57b1001c1e 100644 --- a/packages/page-accounts/src/Sidebar/AddressSection.tsx +++ b/packages/page-accounts/src/Sidebar/AddressSection.tsx @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; +import { CopyToClipboard } from 'react-copy-to-clipboard'; -import { AccountName, IdentityIcon, Input } from '@polkadot/react-components'; +import { AccountName, Button, IdentityIcon, Input } from '@polkadot/react-components'; +import { useToggle } from '@polkadot/react-hooks'; import { AddressFlags } from '@polkadot/react-hooks/types'; import { useTranslation } from '../translate'; @@ -19,6 +21,8 @@ interface Props { function AddressSection ({ accountIndex, defaultValue, editingName, flags, onChange, value }: Props): React.ReactElement { const { t } = useTranslation(); + const [isCopyShown, toggleIsCopyShown] = useToggle(); + const NOOP = () => undefined; return (
@@ -46,15 +50,36 @@ function AddressSection ({ accountIndex, defaultValue, editingName, flags, onCha value={value} withSidebar={false} /> +
{value}
+ {accountIndex && (
{accountIndex}
)}
+ +
+
+ + + +
+
); } diff --git a/packages/page-accounts/src/Sidebar/Sidebar.tsx b/packages/page-accounts/src/Sidebar/Sidebar.tsx index 8f6d9c5834..c437bf288c 100644 --- a/packages/page-accounts/src/Sidebar/Sidebar.tsx +++ b/packages/page-accounts/src/Sidebar/Sidebar.tsx @@ -110,6 +110,15 @@ export default React.memo(styled(FullSidebar)` overflow: hidden; } } + + .ui--AddressSection__CopyColumn { + margin-left: 1rem; + + .ui--AccountName { + max-width: 10rem; + overflow: hidden; + } + } } .ui--AddressMenu-addr, @@ -121,11 +130,26 @@ export default React.memo(styled(FullSidebar)` .ui--AddressMenu-addr { word-break: break-all; - width: 26ch; + width: 24ch; margin: 0.571rem 0; color: var(--color-label); } + .ui--AddressMenu-copyaddr, + .ui--AddressMenu-index { + font: var(--font-mono); + text-align: left; + font-size: 0.857rem; + } + + .ui--AddressMenu-copyaaddr { + word-break: break-all; + width: 12ch; + margin: 0.371rem 0; + color: var(--color-label); + } + + .ui--AddressMenu-index { display: flex; flex-direction: row;