Remove existence & length checks on passwords & phrases (#3854)
* Allow input to receive FormattedMessage errors * Only do existence checks on phrases & passwords * Add missing import * Remove existence checks, display security reminder
This commit is contained in:
@@ -50,7 +50,7 @@ export default class Input extends Component {
|
||||
children: PropTypes.node,
|
||||
className: PropTypes.string,
|
||||
disabled: PropTypes.bool,
|
||||
error: PropTypes.string,
|
||||
error: nodeOrStringProptype(),
|
||||
readOnly: PropTypes.bool,
|
||||
floatCopy: PropTypes.bool,
|
||||
hint: nodeOrStringProptype(),
|
||||
@@ -96,8 +96,7 @@ export default class Input extends Component {
|
||||
|
||||
render () {
|
||||
const { value } = this.state;
|
||||
const { children, className, hideUnderline, disabled, error, label } = this.props;
|
||||
const { hint, multiLine, rows, type, min, max, style } = this.props;
|
||||
const { children, className, disabled, error, hideUnderline, hint, label, max, min, multiLine, rows, style, type } = this.props;
|
||||
|
||||
const readOnly = this.props.readOnly || disabled;
|
||||
|
||||
|
||||
17
js/src/ui/Warning/index.js
Normal file
17
js/src/ui/Warning/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity.
|
||||
|
||||
// Parity is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
export default from './warning';
|
||||
26
js/src/ui/Warning/warning.css
Normal file
26
js/src/ui/Warning/warning.css
Normal file
@@ -0,0 +1,26 @@
|
||||
/* Copyright 2015, 2016 Parity Technologies (UK) Ltd.
|
||||
/* This file is part of Parity.
|
||||
/*
|
||||
/* Parity is free software: you can redistribute it and/or modify
|
||||
/* it under the terms of the GNU General Public License as published by
|
||||
/* the Free Software Foundation, either version 3 of the License, or
|
||||
/* (at your option) any later version.
|
||||
/*
|
||||
/* Parity is distributed in the hope that it will be useful,
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
/* GNU General Public License for more details.
|
||||
/*
|
||||
/* You should have received a copy of the GNU General Public License
|
||||
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
.warning {
|
||||
background: #f80;
|
||||
border-radius: 0.5em;
|
||||
color: white;
|
||||
font-size: 0.75em;
|
||||
margin-bottom: 1em;
|
||||
padding: 0.75em;
|
||||
text-align: center;
|
||||
}
|
||||
41
js/src/ui/Warning/warning.js
Normal file
41
js/src/ui/Warning/warning.js
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity.
|
||||
|
||||
// Parity is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { nodeOrStringProptype } from '~/util/proptypes';
|
||||
|
||||
import styles from './warning.css';
|
||||
|
||||
export default class Warning extends Component {
|
||||
static propTypes = {
|
||||
warning: nodeOrStringProptype()
|
||||
};
|
||||
|
||||
render () {
|
||||
const { warning } = this.props;
|
||||
|
||||
if (!warning) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={ styles.warning }>
|
||||
{ warning }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@ import Tags from './Tags';
|
||||
import Tooltips, { Tooltip } from './Tooltips';
|
||||
import TxHash from './TxHash';
|
||||
import TxList from './TxList';
|
||||
import Warning from './Warning';
|
||||
|
||||
export {
|
||||
Actionbar,
|
||||
@@ -99,5 +100,6 @@ export {
|
||||
Tooltips,
|
||||
TxHash,
|
||||
TxList,
|
||||
TypedInput
|
||||
TypedInput,
|
||||
Warning
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user