1
- import React from ' react' ;
2
- import PropTypes from ' prop-types' ;
1
+ import React from " react" ;
2
+ import PropTypes from " prop-types" ;
3
3
import {
4
4
Animated ,
5
5
Easing ,
8
8
TouchableWithoutFeedback ,
9
9
View ,
10
10
StyleSheet ,
11
- } from ' react-native' ;
11
+ } from " react-native" ;
12
12
13
- import BaseInput from ' ./BaseInput' ;
13
+ import BaseInput from " ./BaseInput" ;
14
14
15
15
export default class Jiro extends BaseInput {
16
16
static propTypes = {
@@ -20,7 +20,7 @@ export default class Jiro extends BaseInput {
20
20
} ;
21
21
22
22
static defaultProps = {
23
- borderColor : ' red' ,
23
+ borderColor : " red" ,
24
24
inputPadding : 16 ,
25
25
height : 48 ,
26
26
} ;
@@ -45,19 +45,22 @@ export default class Jiro extends BaseInput {
45
45
toValue : animationValue ,
46
46
eaasing : Easing . bezier ( 0.2 , 1 , 0.3 , 1 ) ,
47
47
duration : 200 ,
48
+ useNativeDriver : false ,
48
49
}
49
50
) ;
50
51
const borderHeightAnimation = Animated . timing ( this . state . borderHeightAnim , {
51
52
toValue : animationValue ,
52
53
eaasing : Easing . ease ,
53
54
duration : 200 ,
55
+ useNativeDriver : false ,
54
56
} ) ;
55
57
const labelPositionAnimation = Animated . timing (
56
58
this . state . labelPositionAnim ,
57
59
{
58
60
toValue : animationValue ,
59
61
eaasing : Easing . ease ,
60
62
duration : 200 ,
63
+ useNativeDriver : false ,
61
64
}
62
65
) ;
63
66
@@ -135,7 +138,7 @@ export default class Jiro extends BaseInput {
135
138
onBlur = { this . _onBlur }
136
139
onChange = { this . _onChange }
137
140
onFocus = { this . _onFocus }
138
- underlineColorAndroid = { ' transparent' }
141
+ underlineColorAndroid = { " transparent" }
139
142
/>
140
143
< TouchableWithoutFeedback onPress = { this . focus } >
141
144
< Animated . View
@@ -144,15 +147,16 @@ export default class Jiro extends BaseInput {
144
147
{
145
148
bottom : labelPositionAnim . interpolate ( {
146
149
inputRange : [ 0 , 1 ] ,
147
- outputRange : [ inputPadding / 2 , inputHeight + inputPadding / 4 ] ,
150
+ outputRange : [
151
+ inputPadding / 2 ,
152
+ inputHeight + inputPadding / 4 ,
153
+ ] ,
148
154
} ) ,
149
155
left : inputPadding ,
150
156
} ,
151
157
] }
152
158
>
153
- < Text style = { [ styles . label , labelStyle ] } >
154
- { label }
155
- </ Text >
159
+ < Text style = { [ styles . label , labelStyle ] } > { label } </ Text >
156
160
</ Animated . View >
157
161
</ TouchableWithoutFeedback >
158
162
</ View >
@@ -162,24 +166,24 @@ export default class Jiro extends BaseInput {
162
166
163
167
const styles = StyleSheet . create ( {
164
168
labelContainer : {
165
- position : ' absolute' ,
166
- backgroundColor : ' transparent' ,
169
+ position : " absolute" ,
170
+ backgroundColor : " transparent" ,
167
171
} ,
168
172
label : {
169
173
fontSize : 13 ,
170
- fontWeight : ' bold' ,
171
- color : ' #6a7989' ,
174
+ fontWeight : " bold" ,
175
+ color : " #6a7989" ,
172
176
} ,
173
177
textInput : {
174
- position : ' absolute' ,
178
+ position : " absolute" ,
175
179
bottom : 0 ,
176
180
padding : 0 ,
177
- color : ' black' ,
181
+ color : " black" ,
178
182
fontSize : 18 ,
179
- fontWeight : ' bold' ,
183
+ fontWeight : " bold" ,
180
184
} ,
181
185
border : {
182
- position : ' absolute' ,
186
+ position : " absolute" ,
183
187
bottom : 0 ,
184
188
left : 0 ,
185
189
right : 0 ,
0 commit comments