@@ -15,21 +15,28 @@ import styles from '../styles';
1515
1616export default function TextInput ( props ) {
1717 const {
18- input, placeholder, label, layout,
18+ input, placeholder, label, layout, itemSettings, secureTextEntry,
19+ itemstyle, labelStyle,
1920 } = props ;
2021
21- const labelText = label || input . name ;
22- const itemLayout = [ ] ;
22+ const itemLayout = [ itemstyle ] ;
23+ const labelVertical = [ labelStyle ] ;
2324 if ( layout === 'vertical' ) {
2425 itemLayout . push ( styles . fieldVertical ) ;
26+ labelVertical . push ( styles . labelVertical ) ;
2527 }
2628
29+ const labelText = label || input . name ;
30+ const placeholderText = ( itemSettings && itemSettings . floatingLabel === true )
31+ ? null : placeholder ;
32+
2733 return (
28- < Item >
29- < Label > { labelText } </ Label >
34+ < Item { ... itemSettings } style = { itemLayout } >
35+ < Label style = { labelVertical } > { labelText } </ Label >
3036 < Input
31- placeholder = { placeholder }
37+ placeholder = { placeholderText }
3238 onChangeText = { input . onChange }
39+ secureTextEntry = { secureTextEntry }
3340 />
3441 </ Item >
3542 ) ;
@@ -40,11 +47,19 @@ TextInput.defaultProps = {
4047 placeholder : '' ,
4148 label : '' ,
4249 layout : '' ,
50+ itemSettings : { } ,
51+ secureTextEntry : false ,
52+ itemstyle : { } ,
53+ labelStyle : { } ,
4354} ;
4455
4556TextInput . propTypes = {
4657 input : PropTypes . object ,
4758 placeholder : PropTypes . string ,
4859 label : PropTypes . string ,
4960 layout : PropTypes . string ,
61+ itemSettings : PropTypes . object ,
62+ secureTextEntry : PropTypes . bool ,
63+ itemstyle : PropTypes . object ,
64+ labelStyle : PropTypes . object ,
5065} ;
0 commit comments