11import * as React from "react" ;
22import {
3- View ,
43 Dimensions ,
54 StyleProp ,
65 TextInput ,
@@ -13,7 +12,7 @@ import {
1312 */
1413import styles from "./InteractiveTextInput.style" ;
1514
16- const { width : ScreenWidth , height : ScreenHeight } = Dimensions . get ( "screen" ) ;
15+ const { width : ScreenWidth } = Dimensions . get ( "screen" ) ;
1716const AnimatedTextInput = Animated . createAnimatedComponent ( TextInput ) ;
1817
1918const SUCCESS_COLOR = "#008FEB" ;
@@ -26,17 +25,16 @@ type CustomStyleProp = StyleProp<ViewStyle> | Array<StyleProp<ViewStyle>>;
2625interface IInteractiveTextInputProps extends TextInputProps {
2726 style ?: CustomStyleProp ;
2827}
29- interface IProps { }
3028
3129interface IState { }
3230
3331export default class InteractiveTextInput extends React . Component <
34- IProps ,
32+ IInteractiveTextInputProps ,
3533 IState
3634> {
3735 interpolatedColor : Animated . Value ;
3836
39- constructor ( props : IProps ) {
37+ constructor ( props : IInteractiveTextInputProps ) {
4038 super ( props ) ;
4139 this . interpolatedColor = new Animated . Value ( ORIGINAL_VALUE ) ;
4240 this . state = { } ;
@@ -50,7 +48,7 @@ export default class InteractiveTextInput extends React.Component<
5048 } ) . start ( ) ;
5149 } ;
5250
53- showSuccessColor = ( ) => {
51+ showFocusColor = ( ) => {
5452 Animated . timing ( this . interpolatedColor , {
5553 duration : 450 ,
5654 toValue : SUCCESS_VALUE ,
@@ -78,7 +76,7 @@ export default class InteractiveTextInput extends React.Component<
7876 } }
7977 placeholder = "Email"
8078 onFocus = { ( ) => {
81- this . showSuccessColor ( ) ;
79+ this . showFocusColor ( ) ;
8280 } }
8381 onBlur = { ( ) => {
8482 this . showOriginColor ( ) ;
0 commit comments