diff --git a/packages/extension-ui/src/Popup/ImportQr.tsx b/packages/extension-ui/src/Popup/ImportQr.tsx index fc782c321e7..28c8591dab3 100644 --- a/packages/extension-ui/src/Popup/ImportQr.tsx +++ b/packages/extension-ui/src/Popup/ImportQr.tsx @@ -5,9 +5,9 @@ import React, { useContext, useState } from 'react'; import { QrScanAddress } from '@polkadot/react-qr'; -import { ActionContext, Address, Button, Header } from '../components'; +import { ActionContext, ActionText, Address, Button, ButtonArea, Header, VerticalSpace } from '../components'; import { createAccountExternal } from '../messaging'; -import { Back, Name } from '../partials'; +import { Name, TitleWithAction } from '../partials'; type Props = {}; @@ -26,10 +26,16 @@ export default function ImportQr (): React.ReactElement { }; return ( -
+ <>
- - {!account && } + + onAction('/')}/> + + {!account && ( +
+ +
+ )} {account && ( <> {
- {name && ( + /> + + {name && ( +
+ + )} )} -
+ ); } diff --git a/packages/extension-ui/src/Popup/ImportSeed.tsx b/packages/extension-ui/src/Popup/ImportSeed.tsx index 1bd9a7b4146..3f9818a3759 100644 --- a/packages/extension-ui/src/Popup/ImportSeed.tsx +++ b/packages/extension-ui/src/Popup/ImportSeed.tsx @@ -4,9 +4,19 @@ import React, { useContext, useState } from 'react'; -import { ActionContext, Address, Button, Header, TextAreaWithLabel } from '../components'; +import { + ActionContext, + ActionText, + Address, + Button, + ButtonArea, + Header, + TextAreaWithLabel, + VerticalSpace +} from '../components'; import { createAccountSuri, validateSeed } from '../messaging'; -import { Back, Name, Password } from '../partials'; +import { TitleWithAction, Name, Password } from '../partials'; +import styled from 'styled-components'; type Props = {}; @@ -32,10 +42,13 @@ export default function Import (): React.ReactElement { }; return ( -
+ <>
- - + onAction('/')}/> + + { {account && } {account && name && } {account && name && password && ( -
-
+ ); } + +const SeedInput = styled(TextAreaWithLabel)` + margin-bottom: 16px; + + textarea { + height: unset; + } +`; diff --git a/packages/extension-ui/src/components/Address.tsx b/packages/extension-ui/src/components/Address.tsx index 3f095819051..bb539d209de 100644 --- a/packages/extension-ui/src/components/Address.tsx +++ b/packages/extension-ui/src/components/Address.tsx @@ -76,24 +76,26 @@ function Address ({ address, className, children, genesisHash, name, actions }: const theme = ((chain && chain.icon) || 'polkadot') as 'polkadot'; return
- - - - {name || (account && account.name) || ''} - {formatted || ''} - - {actions && +
+ + + + {name || (account && account.name) || ''} + {formatted || ''} + + {actions && <> setShowActionsMenu(!showActionsMenu)} ref={actionsRef}> {showActionsMenu ? : } {showActionsMenu && {actions}} } - - {children} + + {children} +
; } @@ -171,7 +173,10 @@ const ActiveActionsIcon = styled(Svg).attrs(() => ({ export default styled(Address)` position: relative; - background: ${({ theme }): string => theme.highlightedAreaBackground}; + + & > div { + background: ${({ theme }): string => theme.highlightedAreaBackground}; + } & ${Identicon} { margin-left: 25px; diff --git a/packages/extension-ui/src/partials/TitleWithAction.tsx b/packages/extension-ui/src/partials/TitleWithAction.tsx new file mode 100644 index 00000000000..e40deb7fcb9 --- /dev/null +++ b/packages/extension-ui/src/partials/TitleWithAction.tsx @@ -0,0 +1,30 @@ +// Copyright 2019 @polkadot/extension-ui authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import React from 'react'; +import styled from 'styled-components'; +import { Title } from '../components'; + +interface Props { + className?: string; + children: React.ReactNode; + title: string; +} + +function TitleWithAction ({ className, children, title }: Props): React.ReactElement { + return ( +
+ {title} + {children} +
+ ); +} + +export default styled(TitleWithAction)` + display: flex; + + ${Title} { + margin-top: 8px; + } +`; diff --git a/packages/extension-ui/src/partials/index.ts b/packages/extension-ui/src/partials/index.ts index af235985a17..9e48091074a 100644 --- a/packages/extension-ui/src/partials/index.ts +++ b/packages/extension-ui/src/partials/index.ts @@ -5,3 +5,4 @@ export { default as Back } from './Back'; export { default as Name } from './Name'; export { default as Password } from './Password'; +export { default as TitleWithAction } from './TitleWithAction';