diff --git a/packages/ui-signer/src/Modal.tsx b/packages/ui-signer/src/Modal.tsx index 246f748a3d..43334e8591 100644 --- a/packages/ui-signer/src/Modal.tsx +++ b/packages/ui-signer/src/Modal.tsx @@ -19,9 +19,10 @@ import keyring from '@polkadot/ui-keyring'; import { assert, isFunction } from '@polkadot/util'; import { format } from '@polkadot/util/logger'; +import PasswordCheck from './PasswordCheck'; import Transaction from './Transaction'; -import Unlock from './Unlock'; import translate from './translate'; +import Unlock from './Unlock'; type BaseProps = BareProps & { queue: Array, @@ -167,14 +168,19 @@ class Signer extends React.PureComponent { } return ( - + <> + + + ); } diff --git a/packages/ui-signer/src/PasswordCheck.tsx b/packages/ui-signer/src/PasswordCheck.tsx new file mode 100644 index 0000000000..07d0c77967 --- /dev/null +++ b/packages/ui-signer/src/PasswordCheck.tsx @@ -0,0 +1,32 @@ +// Copyright 2017-2019 @polkadot/ui-signer 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 { I18nProps } from '@polkadot/ui-app/types'; + +import React from 'react'; +import styled from 'styled-components'; +import { withMulti } from '@polkadot/ui-api'; + +import translate from './translate'; + +type Props = I18nProps & { + className?: string, + unlockError?: string | null +}; + +function PasswordCheck (props: Props) { + const { className, unlockError, t } = props; + + return unlockError + ?
{t('wrong password')}
+ : null; +} + +export default withMulti( + styled(PasswordCheck)` + margin-left: 15em; + color: #9f3a38; + `, + translate +);