Skip to content

Commit 6568904

Browse files
authored
Merge pull request #2114 from MyCryptoHQ/develop
Release 1.2.2
2 parents b061ae1 + 16ba70d commit 6568904

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2185
-169
lines changed
+135
Loading

common/components/AddressField.tsx

+29-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ interface OwnProps {
1313
isSelfAddress?: boolean;
1414
isCheckSummed?: boolean;
1515
showLabelMatch?: boolean;
16+
showIdenticon?: boolean;
17+
showInputLabel?: boolean;
18+
placeholder?: string;
19+
value?: string;
20+
dropdownThreshold?: number;
21+
onChangeOverride?(ev: React.FormEvent<HTMLInputElement>): void;
1622
}
1723

1824
interface StateProps {
@@ -26,26 +32,42 @@ const AddressField: React.SFC<Props> = ({
2632
isSelfAddress,
2733
isCheckSummed,
2834
showLabelMatch,
29-
toChecksumAddress
35+
toChecksumAddress,
36+
showIdenticon,
37+
placeholder = donationAddressMap.ETH,
38+
showInputLabel = true,
39+
onChangeOverride,
40+
value,
41+
dropdownThreshold
3042
}) => (
3143
<AddressFieldFactory
3244
isSelfAddress={isSelfAddress}
3345
showLabelMatch={showLabelMatch}
46+
showIdenticon={showIdenticon}
47+
onChangeOverride={onChangeOverride}
48+
value={value}
49+
dropdownThreshold={dropdownThreshold}
3450
withProps={({ currentTo, isValid, isLabelEntry, onChange, onFocus, onBlur, readOnly }) => (
3551
<div className="input-group-wrapper">
3652
<label className="input-group">
37-
<div className="input-group-header">
38-
{translate(isSelfAddress ? 'X_ADDRESS' : 'SEND_ADDR')}
39-
</div>
53+
{showInputLabel && (
54+
<div className="input-group-header">
55+
{translate(isSelfAddress ? 'X_ADDRESS' : 'SEND_ADDR')}
56+
</div>
57+
)}
4058
<Input
4159
className={`input-group-input ${!isValid && !isLabelEntry ? 'invalid' : ''}`}
4260
isValid={isValid}
4361
type="text"
44-
value={isCheckSummed ? toChecksumAddress(currentTo.raw) : currentTo.raw}
45-
placeholder={donationAddressMap.ETH}
62+
value={
63+
value != null
64+
? value
65+
: isCheckSummed ? toChecksumAddress(currentTo.raw) : currentTo.raw
66+
}
67+
placeholder={placeholder}
4668
readOnly={!!(isReadOnly || readOnly)}
4769
spellCheck={false}
48-
onChange={onChange}
70+
onChange={onChangeOverride || onChange}
4971
onFocus={onFocus}
5072
onBlur={onBlur}
5173
/>

common/components/AddressFieldFactory/AddressFieldDropdown.scss

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050

5151
&-label {
5252
flex: 1 0 0;
53+
padding-left: 0.2rem;
54+
text-align: left;
5355
}
5456

5557
&-address {

0 commit comments

Comments
 (0)