Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Common/EnhancedInputs.js
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | export const SendBchInput = ({ | ||||
); | ); | ||||
return ( | return ( | ||||
<AntdFormWrapper> | <AntdFormWrapper> | ||||
<Form.Item {...otherProps}> | <Form.Item {...otherProps}> | ||||
<Input.Group compact> | <Input.Group compact> | ||||
<Input | <Input | ||||
style={{ width: '60%', textAlign: 'left' }} | style={{ width: '60%', textAlign: 'left' }} | ||||
type="number" | type="number" | ||||
/*event.target.blur() is used as event.preventDefault() | |||||
will not work on passive targets such as onWheel */ | |||||
onWheel={event => event.target.blur()} | |||||
step={ | step={ | ||||
inputProps.dollar === 1 | inputProps.dollar === 1 | ||||
? 0.01 | ? 0.01 | ||||
: 1 / 10 ** currency.cashDecimals | : 1 / 10 ** currency.cashDecimals | ||||
} | } | ||||
prefix={ | prefix={ | ||||
inputProps.dollar === 1 ? ( | inputProps.dollar === 1 ? ( | ||||
<ThemedDollarOutlined /> | <ThemedDollarOutlined /> | ||||
Show All 34 Lines | |||||
}; | }; | ||||
export const DestinationAmount = ({ onMax, inputProps, ...otherProps }) => { | export const DestinationAmount = ({ onMax, inputProps, ...otherProps }) => { | ||||
return ( | return ( | ||||
<AntdFormWrapper> | <AntdFormWrapper> | ||||
<Form.Item {...otherProps}> | <Form.Item {...otherProps}> | ||||
<Input | <Input | ||||
type="number" | type="number" | ||||
/*event.target.blur() is used as event.preventDefault() | |||||
will not work on passive targets such as onWheel */ | |||||
onWheel={event => event.target.blur()} | |||||
prefix={ | prefix={ | ||||
<img | <img | ||||
src={currency.logo} | src={currency.logo} | ||||
alt="" | alt="" | ||||
width={16} | width={16} | ||||
height={16} | height={16} | ||||
/> | /> | ||||
} | } | ||||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |