Add wrong password indication (#1364)
* add wronf password indication * white space * with className * alphabetical order
This commit is contained in:
parent
5d163145bc
commit
5528247e85
@ -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<QueueTx>,
|
||||
@ -167,14 +168,19 @@ class Signer extends React.PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
return (
|
||||
<Unlock
|
||||
autoFocus
|
||||
error={unlockError || undefined}
|
||||
onChange={this.onChangePassword}
|
||||
password={password}
|
||||
value={currentItem.accountId}
|
||||
tabIndex={1}
|
||||
/>
|
||||
<>
|
||||
<Unlock
|
||||
autoFocus
|
||||
error={unlockError || undefined}
|
||||
onChange={this.onChangePassword}
|
||||
password={password}
|
||||
value={currentItem.accountId}
|
||||
tabIndex={1}
|
||||
/>
|
||||
<PasswordCheck
|
||||
unlockError={unlockError}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
32
packages/ui-signer/src/PasswordCheck.tsx
Normal file
32
packages/ui-signer/src/PasswordCheck.tsx
Normal file
@ -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
|
||||
? <div className={className}>{t('wrong password')}</div>
|
||||
: null;
|
||||
}
|
||||
|
||||
export default withMulti(
|
||||
styled(PasswordCheck)`
|
||||
margin-left: 15em;
|
||||
color: #9f3a38;
|
||||
`,
|
||||
translate
|
||||
);
|
||||
Loading…
Reference in New Issue
Block a user