mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-26 09:45:18 +00:00
Fix input validation styles (#1778)
* Fix input validation styles * Remove green borders
This commit is contained in:
parent
58949dd44e
commit
a77aa3a02c
@ -34,7 +34,7 @@
|
|||||||
&-refresh {
|
&-refresh {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0rem;
|
bottom: 1rem;
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,12 +37,6 @@
|
|||||||
padding-right: $space;
|
padding-right: $space;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control {
|
|
||||||
display: inline-block;
|
|
||||||
width: auto;
|
|
||||||
margin: 0 0 0 10px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&-addresses {
|
&-addresses {
|
||||||
|
@ -85,13 +85,13 @@
|
|||||||
border-color: $brand-danger;
|
border-color: $brand-danger;
|
||||||
box-shadow: inset 0px 0px 0px 1px $brand-danger;
|
box-shadow: inset 0px 0px 0px 1px $brand-danger;
|
||||||
}
|
}
|
||||||
|
&.valid.has-value {
|
||||||
|
border-color: #8dd17b;
|
||||||
|
box-shadow: inset 0px 0px 0px 1px #8dd17b;
|
||||||
|
}
|
||||||
&:focus {
|
&:focus {
|
||||||
border-color: #4295bc;
|
border-color: #4295bc;
|
||||||
box-shadow: inset 0px 0px 0px 1px #4295bc;
|
box-shadow: inset 0px 0px 0px 1px #4295bc;
|
||||||
&.valid {
|
|
||||||
border-color: #8dd17b;
|
|
||||||
box-shadow: inset 0px 0px 0px 1px #8dd17b;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,7 @@ class Input extends React.Component<OwnProps, State> {
|
|||||||
const classname = classnames(
|
const classname = classnames(
|
||||||
this.props.className,
|
this.props.className,
|
||||||
'input-group-input',
|
'input-group-input',
|
||||||
'form-control',
|
this.state.isStateless ? '' : isValid ? (showValidAsPlain ? '' : '') : `invalid`,
|
||||||
this.state.isStateless
|
|
||||||
? ''
|
|
||||||
: isValid ? (showValidAsPlain ? '' : `is-valid valid`) : `is-invalid invalid`,
|
|
||||||
this.state.hasBlurred && 'has-blurred',
|
this.state.hasBlurred && 'has-blurred',
|
||||||
hasValue && 'has-value'
|
hasValue && 'has-value'
|
||||||
);
|
);
|
||||||
|
@ -70,14 +70,7 @@ export default class DropdownComponent<T> extends PureComponent<Props<T>, State>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ul className={menuClass} style={searchable ? searchableStyle : undefined}>
|
<ul className={menuClass} style={searchable ? searchableStyle : undefined}>
|
||||||
{searchable && (
|
{searchable && <input placeholder={'Search'} onChange={onSearchChange} value={search} />}
|
||||||
<input
|
|
||||||
className="form-control"
|
|
||||||
placeholder={'Search'}
|
|
||||||
onChange={onSearchChange}
|
|
||||||
value={search}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{options
|
{options
|
||||||
.filter(option => {
|
.filter(option => {
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
import React, { PureComponent } from 'react';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
value?: string;
|
|
||||||
options: string[];
|
|
||||||
onChange(event: React.FormEvent<HTMLSpanElement>): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class SimpleSelect extends PureComponent<Props, {}> {
|
|
||||||
public render() {
|
|
||||||
return (
|
|
||||||
<select
|
|
||||||
value={this.props.value || this.props.options[0]}
|
|
||||||
className="form-control"
|
|
||||||
onChange={this.props.onChange}
|
|
||||||
>
|
|
||||||
{this.props.options.map((obj, i) => {
|
|
||||||
return (
|
|
||||||
<option value={obj} key={i}>
|
|
||||||
{obj}
|
|
||||||
</option>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</select>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,10 +27,7 @@ class TextArea extends React.Component<OwnProps, State> {
|
|||||||
const classname = classnames(
|
const classname = classnames(
|
||||||
this.props.className,
|
this.props.className,
|
||||||
'input-group-input',
|
'input-group-input',
|
||||||
'form-control',
|
this.state.isStateless ? '' : isValid ? (showValidAsPlain ? '' : '') : `invalid`,
|
||||||
this.state.isStateless
|
|
||||||
? ''
|
|
||||||
: isValid ? (showValidAsPlain ? '' : `is-valid valid`) : `is-invalid invalid`,
|
|
||||||
this.state.hasBlurred && 'has-blurred'
|
this.state.hasBlurred && 'has-blurred'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ export default class CurrencySwap extends PureComponent<Props, State> {
|
|||||||
<div className="input-group input-group-inline">
|
<div className="input-group input-group-inline">
|
||||||
<Input
|
<Input
|
||||||
id="origin-swap-input"
|
id="origin-swap-input"
|
||||||
isValid={this.isMinMaxValid(origin.amount, origin.label, destination.label)}
|
isValid={!originErr}
|
||||||
type="number"
|
type="number"
|
||||||
placeholder={translateRaw('SEND_AMOUNT_SHORT')}
|
placeholder={translateRaw('SEND_AMOUNT_SHORT')}
|
||||||
value={isNaN(origin.amount) ? '' : origin.amount}
|
value={isNaN(origin.amount) ? '' : origin.amount}
|
||||||
@ -336,7 +336,7 @@ export default class CurrencySwap extends PureComponent<Props, State> {
|
|||||||
<div className="input-group-header">{translate('SWAP_RECEIVE_INPUT_LABEL')}</div>
|
<div className="input-group-header">{translate('SWAP_RECEIVE_INPUT_LABEL')}</div>
|
||||||
<Input
|
<Input
|
||||||
id="destination-swap-input"
|
id="destination-swap-input"
|
||||||
isValid={this.isMinMaxValid(origin.amount, origin.label, destination.label)}
|
isValid={!destinationErr}
|
||||||
type="number"
|
type="number"
|
||||||
placeholder={translateRaw('SEND_AMOUNT_SHORT')}
|
placeholder={translateRaw('SEND_AMOUNT_SHORT')}
|
||||||
value={isNaN(destination.amount) ? '' : destination.amount}
|
value={isNaN(destination.amount) ? '' : destination.amount}
|
||||||
|
@ -87,7 +87,7 @@ Rate: ${rates[pair].rate} ${origin.label}/${destination.label}`;
|
|||||||
isValid={true}
|
isValid={true}
|
||||||
showValidAsPlain={true}
|
showValidAsPlain={true}
|
||||||
defaultValue={fallbackBody}
|
defaultValue={fallbackBody}
|
||||||
className="form-control input-sm"
|
className="input-sm"
|
||||||
rows={9}
|
rows={9}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
z-index: 999;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,12 +12,6 @@ label {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
label + .form-control,
|
|
||||||
label + input,
|
|
||||||
label + textarea {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type='radio'],
|
input[type='radio'],
|
||||||
input[type='checkbox'] {
|
input[type='checkbox'] {
|
||||||
margin: 3px 0 0;
|
margin: 3px 0 0;
|
||||||
@ -29,24 +23,6 @@ input[readonly] {
|
|||||||
cursor: text !important;
|
cursor: text !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control {
|
|
||||||
margin-bottom: $space-sm;
|
|
||||||
transition: $transition;
|
|
||||||
padding: $input-padding;
|
|
||||||
@include mono;
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
border-color: $input-border-focus;
|
|
||||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 1px rgba($brand-primary, 0.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input.form-control,
|
|
||||||
select.form-control {
|
|
||||||
padding-top: 0;
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group {
|
.form-group {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: $form-group-margin-bottom;
|
margin-bottom: $form-group-margin-bottom;
|
||||||
@ -58,31 +34,6 @@ select.form-control {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom feedback classes
|
|
||||||
@mixin form-control-state($color) {
|
|
||||||
border-color: lighten($color, 20%);
|
|
||||||
@include input-shadow($color);
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
border-color: lighten($color, 5%);
|
|
||||||
@include input-focus-shadow($color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-control {
|
|
||||||
&.is-valid {
|
|
||||||
@include form-control-state($brand-success);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.is-invalid {
|
|
||||||
@include form-control-state($brand-danger);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.is-semivalid {
|
|
||||||
@include form-control-state($brand-warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.help-block {
|
.help-block {
|
||||||
&.is-valid {
|
&.is-valid {
|
||||||
color: $brand-success;
|
color: $brand-success;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user