1
1
import React , { Component } from 'react' ;
2
- import { ScrollView , StyleSheet } from 'react-native' ;
2
+ import { ScrollView , StyleSheet , Alert } from 'react-native' ;
3
3
import { Colors , Typography , View , Text , TextField , TextArea , Modal , Button } from 'react-native-ui-lib' ; //eslint-disable-line
4
4
import { KeyboardAwareInsetsView } from 'react-native-keyboard-tracking-view' ;
5
- import icon from '../../assets/icons/richText.png' ;
6
- import dropDown from '../../assets/icons/chevronDown.png' ;
7
5
8
6
7
+ const richText = require ( '../../assets/icons/richText.png' ) ;
8
+ const dropDown = require ( '../../assets/icons/chevronDown.png' ) ;
9
+ const star = require ( '../../assets/icons/star.png' ) ;
10
+
9
11
const LONG_TEXT =
10
12
'Concept, edition and design direction for the editorial piece “La Forma Bruta” by the photographer' +
11
13
'Martín Bollati. In this piece' ;
@@ -37,7 +39,7 @@ export default class InputsScreen extends Component {
37
39
}
38
40
39
41
onPressInfo = ( ) => {
40
- console . warn ( 'onPressInfo ') ;
42
+ Alert . alert ( 'Info button press ') ;
41
43
}
42
44
43
45
onChangeText = ( text ) => {
@@ -60,6 +62,7 @@ export default class InputsScreen extends Component {
60
62
< View flex >
61
63
< ScrollView
62
64
contentContainerStyle = { styles . container }
65
+ showsVerticalScrollIndicator = { false }
63
66
keyboardShouldPersistTaps = "always"
64
67
getTextInputRefs = { ( ) => [ this . noUnderline , this . hugeText ] }
65
68
>
@@ -78,7 +81,7 @@ export default class InputsScreen extends Component {
78
81
text70
79
82
containerStyle = { { marginBottom : INPUT_SPACING } }
80
83
floatingPlaceholder
81
- placeholder = "floatingPlaceholder & error"
84
+ placeholder = "FloatingPlaceholder & error"
82
85
onChangeText = { this . onChangeText }
83
86
error = { this . state . error }
84
87
useTopErrors = { this . state . topError }
@@ -102,7 +105,7 @@ export default class InputsScreen extends Component {
102
105
text70
103
106
containerStyle = { { marginBottom : INPUT_SPACING } }
104
107
floatingPlaceholder
105
- placeholder = "& helperText"
108
+ placeholder = "With helperText"
106
109
helperText = "this is an helper text"
107
110
onChangeText = { this . onChangeText }
108
111
error = { this . state . error }
@@ -113,7 +116,7 @@ export default class InputsScreen extends Component {
113
116
text70
114
117
containerStyle = { { marginBottom : INPUT_SPACING } }
115
118
floatingPlaceholder
116
- placeholder = "multiline & helperText"
119
+ placeholder = "Multiline & helperText"
117
120
multiline
118
121
helperText = "this is an helper text"
119
122
/>
@@ -122,7 +125,7 @@ export default class InputsScreen extends Component {
122
125
text70
123
126
containerStyle = { { marginBottom : INPUT_SPACING } }
124
127
title = "title"
125
- placeholder = "character counter & error"
128
+ placeholder = "Character counter & error"
126
129
maxLength = { 3 }
127
130
showCharacterCounter
128
131
onChangeText = { this . onChangeText }
@@ -135,7 +138,7 @@ export default class InputsScreen extends Component {
135
138
containerStyle = { { marginBottom : INPUT_SPACING } }
136
139
title = "Title"
137
140
titleStyle = { { fontSize : Typography . text70 . fontSize } }
138
- placeholder = "multiline & titleStyle"
141
+ placeholder = "Multiline & titleStyle"
139
142
multiline
140
143
maxLength = { 32 }
141
144
showCharacterCounter
@@ -149,7 +152,7 @@ export default class InputsScreen extends Component {
149
152
text70
150
153
containerStyle = { { marginBottom : INPUT_SPACING } }
151
154
floatingPlaceholder
152
- placeholder = "character counter & expandable"
155
+ placeholder = "Character counter & expandable"
153
156
expandable
154
157
maxLength = { 20 }
155
158
showCharacterCounter
@@ -161,7 +164,7 @@ export default class InputsScreen extends Component {
161
164
floatingPlaceholder
162
165
placeholderTextColor = { Colors . cyan30 }
163
166
floatingPlaceholderColor = { Colors . cyan30 }
164
- placeholder = "underline colors & error"
167
+ placeholder = "Underline colors & error"
165
168
onChangeText = { this . onChangeText }
166
169
error = { this . state . error }
167
170
useTopErrors = { this . state . topError }
@@ -171,14 +174,14 @@ export default class InputsScreen extends Component {
171
174
< TextField
172
175
text40
173
176
containerStyle = { { marginBottom : INPUT_SPACING } }
174
- placeholder = "write something.."
177
+ placeholder = "Write something.."
175
178
hideUnderline
176
179
/>
177
180
178
181
< TextField
179
182
text30
180
183
containerStyle = { { marginBottom : INPUT_SPACING } }
181
- placeholder = "write something.."
184
+ placeholder = "Write something.."
182
185
centered
183
186
hideUnderline
184
187
/>
@@ -234,7 +237,7 @@ export default class InputsScreen extends Component {
234
237
text70
235
238
containerStyle = { { marginBottom : INPUT_SPACING } }
236
239
floatingPlaceholder
237
- placeholder = "with price transformer"
240
+ placeholder = "With price transformer"
238
241
value = { this . state . value }
239
242
transformer = { transformPrice }
240
243
/>
@@ -243,24 +246,32 @@ export default class InputsScreen extends Component {
243
246
text70
244
247
containerStyle = { { marginBottom : INPUT_SPACING } }
245
248
floatingPlaceholder
246
- placeholder = "Right button"
247
- rightButtonProps = { { iconSource : icon , onPress : this . onPressInfo } }
249
+ placeholder = "With right button"
250
+ rightButtonProps = { { iconSource : richText , onPress : this . onPressInfo } }
248
251
/>
249
252
250
253
< TextField
251
254
text70
252
255
containerStyle = { { marginBottom : INPUT_SPACING , width : 210 } }
253
256
floatingPlaceholder
254
- placeholder = "Multiline & Right button"
257
+ placeholder = "Multiline & right button"
255
258
multiline
256
- rightButtonProps = { { iconSource : icon , onPress : this . onPressInfo , style : { tintColor : Colors . red30 } } }
259
+ rightButtonProps = { { iconSource : richText , onPress : this . onPressInfo , iconColor : Colors . red30 } }
257
260
/>
258
261
259
262
< TextField
260
263
text70
261
264
containerStyle = { { marginBottom : INPUT_SPACING } }
262
265
floatingPlaceholder
263
- placeholder = "Expandable & rightIconSource"
266
+ placeholder = "With right icon"
267
+ rightIconSource = { star }
268
+ />
269
+
270
+ < TextField
271
+ text70
272
+ containerStyle = { { marginBottom : INPUT_SPACING } }
273
+ floatingPlaceholder
274
+ placeholder = "Expandable & right icon"
264
275
expandable
265
276
rightIconSource = { dropDown }
266
277
/>
@@ -275,7 +286,7 @@ export default class InputsScreen extends Component {
275
286
borderColor : Colors . dark60 ,
276
287
} }
277
288
>
278
- < TextArea placeholder = "write something.." />
289
+ < TextArea placeholder = "Write something.." />
279
290
</ View >
280
291
281
292
< TextField
0 commit comments