1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-27 10:48:22 +00:00

fix default input state

This commit is contained in:
slowbackspace 2019-03-25 10:21:45 +01:00
parent f763742dd5
commit bf8acd1679
4 changed files with 18 additions and 18 deletions

View File

@ -81,8 +81,8 @@ const AdvancedSettingsSendButtonWrapper = styled.div`
justify-content: flex-end;
`;
const getGasLimitInputState = (gasLimitErrors: string, gasLimitWarnings: string): string => {
let state = '';
const getGasLimitInputState = (gasLimitErrors: string, gasLimitWarnings: string): ?string => {
let state = null;
if (gasLimitWarnings && !gasLimitErrors) {
state = 'warning';
}
@ -92,8 +92,8 @@ const getGasLimitInputState = (gasLimitErrors: string, gasLimitWarnings: string)
return state;
};
const getGasPriceInputState = (gasPriceErrors: string, gasPriceWarnings: string): string => {
let state = '';
const getGasPriceInputState = (gasPriceErrors: string, gasPriceWarnings: string): ?string => {
let state = null;
if (gasPriceWarnings && !gasPriceErrors) {
state = 'warning';
}
@ -103,8 +103,8 @@ const getGasPriceInputState = (gasPriceErrors: string, gasPriceWarnings: string)
return state;
};
const getDataTextareaState = (dataError: string, dataWarning: string): string => {
let state = '';
const getDataTextareaState = (dataError: string, dataWarning: string): ?string => {
let state = null;
if (dataWarning) {
state = 'warning';
}

View File

@ -236,8 +236,8 @@ const getAddressInputState = (
address: string,
addressErrors: string,
addressWarnings: string
): string => {
let state = '';
): ?string => {
let state = null;
if (address && !addressErrors) {
state = 'success';
}
@ -250,8 +250,8 @@ const getAddressInputState = (
return state;
};
const getAmountInputState = (amountErrors: string, amountWarnings: string): string => {
let state = '';
const getAmountInputState = (amountErrors: string, amountWarnings: string): ?string => {
let state = null;
if (amountWarnings && !amountErrors) {
state = 'warning';
}

View File

@ -68,8 +68,8 @@ const StyledIcon = styled(Icon)`
margin-left: 6px;
`;
const getFeeInputState = (feeErrors: string, feeWarnings: string): string => {
let state = '';
const getFeeInputState = (feeErrors: string, feeWarnings: string): ?string => {
let state = null;
if (feeWarnings && !feeErrors) {
state = 'warning';
}
@ -79,8 +79,8 @@ const getFeeInputState = (feeErrors: string, feeWarnings: string): string => {
return state;
};
const getDestinationTagInputState = (errors: string, warnings: string): string => {
let state = '';
const getDestinationTagInputState = (errors: string, warnings: string): ?string => {
let state = null;
if (warnings && !errors) {
state = 'warning';
}

View File

@ -234,8 +234,8 @@ const getAddressInputState = (
address: string,
addressErrors: string,
addressWarnings: string
): string => {
let state = '';
): ?string => {
let state = null;
if (address && !addressErrors) {
state = 'success';
}
@ -248,8 +248,8 @@ const getAddressInputState = (
return state;
};
const getAmountInputState = (amountErrors: string, amountWarnings: string): string => {
let state = '';
const getAmountInputState = (amountErrors: string, amountWarnings: string): ?string => {
let state = null;
if (amountWarnings && !amountErrors) {
state = 'warning';
}