diff --git a/packages/app-toolbox/src/Unlock.tsx b/packages/app-toolbox/src/Unlock.tsx index 8164a26fa3..1ab57271a8 100644 --- a/packages/app-toolbox/src/Unlock.tsx +++ b/packages/app-toolbox/src/Unlock.tsx @@ -6,9 +6,7 @@ import { I18nProps } from '@polkadot/ui-app/types'; import { KeyringPair } from '@polkadot/keyring/types'; import React from 'react'; -import styled from 'styled-components'; -import { Trans } from 'react-i18next'; -import { Button, IdentityIcon, Modal, Password } from '@polkadot/ui-app'; +import { AddressRow, Button, Modal, Password } from '@polkadot/ui-app'; import translate from './translate'; @@ -23,31 +21,6 @@ type State = { unlockError: string | null }; -const WrapperContent = styled.div` - align-content: center; - display: flex; - line-height: 1.5em; - - .expanded { - padding-right: 2em; - - .code { - background: #f5f5f5; - font-family: monospace; - margin: 0 0.25em; - overflow-wrap: break-word; - padding: 0.25em 0.5em; - word-break: break-all; - word-break: break-word; - word-wrap: break-word; - } - } -`; - -const WrapperEntry = styled.div` - padding-top: 1.5rem; -`; - class Unlock extends React.PureComponent { state: State = { address: '', @@ -64,7 +37,11 @@ class Unlock extends React.PureComponent { } render () { - const { t } = this.props; + const { pair, t } = this.props; + + if (!pair) { + return null; + } return ( { {t('Unlock account')} - - {this.renderContent()} - - - {this.renderActions()} - + {this.renderContent()} + {this.renderActions()} ); } - renderActions () { + private renderActions () { const { t } = this.props; return ( - -