File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,15 @@ import InteractiveTextInput from "./lib/InteractiveTextInput";
1515const App = ( ) => {
1616 return (
1717 < SafeAreaView
18- style = { { flex : 1 , alignItems : "center" , justifyContent : "center" } }
18+ style = { {
19+ height : 300 ,
20+ alignItems : "center" ,
21+ justifyContent : "space-evenly" ,
22+ } }
1923 >
2024 < InteractiveTextInput />
25+ < InteractiveTextInput />
26+ < InteractiveTextInput />
2127 </ SafeAreaView >
2228 ) ;
2329} ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const SUCCESS_COLOR = "#008FEB";
1919const ORIGINAL_COLOR = "transparent" ;
2020const ORIGINAL_VALUE = 0 ;
2121const SUCCESS_VALUE = 1 ;
22+ const PLACEHOLDER_COLOR = "#757575" ;
2223
2324type CustomStyleProp = StyleProp < ViewStyle > | Array < StyleProp < ViewStyle > > ;
2425
@@ -42,7 +43,7 @@ export default class InteractiveTextInput extends React.Component<
4243
4344 showOriginColor = ( ) => {
4445 Animated . timing ( this . interpolatedColor , {
45- duration : 450 ,
46+ duration : 350 ,
4647 toValue : ORIGINAL_VALUE ,
4748 useNativeDriver : false ,
4849 } ) . start ( ) ;
@@ -61,6 +62,10 @@ export default class InteractiveTextInput extends React.Component<
6162 inputRange : [ ORIGINAL_VALUE , SUCCESS_VALUE ] ,
6263 outputRange : [ ORIGINAL_COLOR , SUCCESS_COLOR ] ,
6364 } ) ;
65+ let placeholderTextColor = this . interpolatedColor . interpolate ( {
66+ inputRange : [ ORIGINAL_VALUE , SUCCESS_VALUE ] ,
67+ outputRange : [ PLACEHOLDER_COLOR , SUCCESS_COLOR ] ,
68+ } ) ;
6469 return (
6570 < AnimatedTextInput
6671 style = { {
@@ -74,6 +79,7 @@ export default class InteractiveTextInput extends React.Component<
7479 borderWidth : 1 ,
7580 borderColor : borderColor ,
7681 } }
82+ placeholderTextColor = { placeholderTextColor }
7783 placeholder = "Email"
7884 onFocus = { ( ) => {
7985 this . showFocusColor ( ) ;
You can’t perform that action at this time.
0 commit comments