Skip to content

Commit 8609f12

Browse files
authored
account input updates (#531)
1 parent b58116a commit 8609f12

File tree

2 files changed

+53
-57
lines changed

2 files changed

+53
-57
lines changed

app/components/UI/AccountInput/index.js

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,49 @@ const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
1919

2020
const styles = StyleSheet.create({
2121
root: {
22-
flex: 1,
23-
borderColor: colors.inputBorderColor,
24-
borderRadius: 4,
25-
borderWidth: 1
22+
flex: 1
2623
},
2724
arrow: {
2825
color: colors.inputBorderColor,
2926
position: 'absolute',
3027
right: 10,
31-
top: Platform.OS === 'android' ? 16 : 14
28+
top: Platform.OS === 'android' ? 14 : 12
3229
},
3330
componentContainer: {
34-
position: 'relative',
3531
maxHeight: Platform.OS === 'android' ? 175 : 200,
36-
borderColor: colors.inputBorderColor,
3732
borderRadius: 4,
38-
borderWidth: 1
33+
flex: 1
3934
},
4035
input: {
4136
...fontStyles.bold,
4237
backgroundColor: colors.white,
43-
paddingHorizontal: 0,
44-
paddingVertical: 0,
45-
width: '100%'
38+
marginRight: 24
4639
},
47-
inputContainer: {
48-
fontSize: 16,
49-
paddingBottom: 12,
50-
paddingRight: 40,
51-
paddingLeft: 52,
52-
paddingTop: Platform.OS === 'android' ? 10 : 12,
53-
position: 'relative',
54-
minHeight: Platform.OS === 'android' ? 22 : 50,
55-
flex: 1,
40+
qrCodeButton: {
41+
minHeight: Platform.OS === 'android' ? 50 : 50,
42+
paddingRight: 8,
43+
paddingLeft: 12,
44+
paddingTop: 2,
5645
flexDirection: 'row',
5746
alignItems: 'center'
5847
},
59-
inputContent: {
48+
accountContainer: {
6049
flex: 1,
61-
flexDirection: 'column',
62-
alignItems: 'flex-start'
50+
flexDirection: 'row',
51+
backgroundColor: colors.white,
52+
borderColor: colors.inputBorderColor,
53+
borderRadius: 4,
54+
borderWidth: 1
55+
},
56+
toContainer: {
57+
flexDirection: 'column'
58+
},
59+
inputContainer: {
60+
fontSize: 16,
61+
paddingLeft: 8,
62+
flexDirection: 'row',
63+
alignItems: 'center',
64+
marginRight: 48
6365
},
6466
option: {
6567
flexDirection: 'row',
@@ -89,7 +91,7 @@ const styles = StyleSheet.create({
8991
borderRadius: 4,
9092
borderWidth: 1,
9193
paddingBottom: 12,
92-
paddingTop: 10,
94+
paddingTop: 12,
9395
width: '100%',
9496
top: 0,
9597
left: 0,
@@ -99,19 +101,10 @@ const styles = StyleSheet.create({
99101
flex: 1,
100102
paddingLeft: 8
101103
},
102-
qrCodeButton: {
103-
position: 'absolute',
104-
left: 5,
105-
minHeight: Platform.OS === 'android' ? 22 : 50,
106-
flex: 1,
107-
flexDirection: 'row',
108-
alignItems: 'center',
109-
paddingTop: 7,
110-
paddingHorizontal: 10
111-
},
112104
ensAddress: {
113105
fontSize: 10,
114-
top: Platform.OS === 'android' ? -8 : 0
106+
top: Platform.OS === 'android' ? -16 : 0,
107+
paddingLeft: Platform.OS === 'android' ? 4 : 0
115108
}
116109
});
117110

@@ -263,7 +256,7 @@ class AccountInput extends Component {
263256
renderOptionList() {
264257
const { visibleOptions = this.props.accounts } = this.state;
265258
return (
266-
<ElevatedView elevation={10} style={styles.root}>
259+
<ElevatedView elevation={10}>
267260
<ScrollView style={styles.componentContainer}>
268261
<View style={styles.optionList}>
269262
{Object.keys(visibleOptions).map(address =>
@@ -309,26 +302,31 @@ class AccountInput extends Component {
309302
const { placeholder } = this.props;
310303
return (
311304
<View style={styles.root}>
312-
<View style={styles.inputContainer}>
313-
<View style={styles.inputContent}>
314-
<TextInput
315-
autoCapitalize="none"
316-
autoCorrect={false}
317-
onChangeText={this.onChange}
318-
placeholder={placeholder}
319-
spellCheck={false}
320-
style={styles.input}
321-
value={value}
322-
onBlur={this.onBlur}
323-
onFocus={this.onInputFocus}
324-
/>
325-
{ensRecipient && <Text style={styles.ensAddress}>{renderShortAddress(address)}</Text>}
305+
<View style={styles.accountContainer}>
306+
<TouchableOpacity onPress={this.scan} style={styles.qrCodeButton}>
307+
<Icon name="qrcode" size={Platform.OS === 'android' ? 28 : 28} />
308+
</TouchableOpacity>
309+
<View style={styles.inputContainer}>
310+
<View style={styles.toContainer}>
311+
<TextInput
312+
autoCapitalize="none"
313+
autoCorrect={false}
314+
onChangeText={this.onChange}
315+
placeholder={placeholder}
316+
spellCheck={false}
317+
style={styles.input}
318+
value={value}
319+
onBlur={this.onBlur}
320+
onFocus={this.onInputFocus}
321+
/>
322+
<View style={styles.ensView}>
323+
{ensRecipient && <Text style={styles.ensAddress}>{renderShortAddress(address)}</Text>}
324+
</View>
325+
</View>
326326
</View>
327+
<MaterialIcon onPress={this.onFocus} name={'arrow-drop-down'} size={24} style={styles.arrow} />
327328
</View>
328-
<TouchableOpacity onPress={this.scan} style={styles.qrCodeButton}>
329-
<Icon name="qrcode" size={Platform.OS === 'android' ? 28 : 28} />
330-
</TouchableOpacity>
331-
<MaterialIcon onPress={this.onFocus} name={'arrow-drop-down'} size={24} style={styles.arrow} />
329+
332330
{isOpen && this.renderOptionList()}
333331
</View>
334332
);

app/components/UI/EthInput/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ const styles = StyleSheet.create({
8484
componentContainer: {
8585
position: 'relative',
8686
maxHeight: 200,
87-
borderColor: colors.inputBorderColor,
88-
borderRadius: 4,
89-
borderWidth: 1
87+
borderRadius: 4
9088
},
9189
optionList: {
9290
backgroundColor: colors.white,

0 commit comments

Comments
 (0)