@@ -6,12 +6,13 @@ import type {
66 TextStyle ,
77 ViewStyle ,
88} from 'react-native'
9- import { TextInput as RNTextInput , View } from 'react-native'
9+ import { TextInput as RNTextInput , StyleSheet , View } from 'react-native'
1010import styled from 'styled-components/native'
1111import TextInputOutlined from './TextInputOutlined'
1212import { CustomIcon , CustomIconProps , Error } from './components'
1313import { isIOS } from '../../helpers'
1414import TextInputFlat from './TextInputFlat'
15+ import { useTheme } from '../../hooks'
1516
1617export interface TextInputProps extends RNTextInputProperties {
1718 /** Style for container */
@@ -96,6 +97,7 @@ export const TextInput = forwardRef<TextInputRef, TextInputProps>(
9697 } ,
9798 ref ,
9899 ) => {
100+ const TextInputTheme = useTheme ( ) . components . TextInput
99101 const inputRef = useRef < RNTextInput > ( null )
100102
101103 useImperativeHandle ( ref , ( ) => ( {
@@ -109,23 +111,29 @@ export const TextInput = forwardRef<TextInputRef, TextInputProps>(
109111 } , [ ] )
110112
111113 return (
112- < View style = { containerStyle } >
114+ < View style = { [ StyleSheet . flatten ( TextInputTheme . containerStyle ) , StyleSheet . flatten ( containerStyle ) ] } >
113115 { ! ! label && (
114- < Title testID = "test-title" style = { labelStyle } { ...labelProps } >
116+ < Title
117+ testID = "test-title"
118+ style = { [ StyleSheet . flatten ( TextInputTheme . labelStyle ) , StyleSheet . flatten ( labelStyle ) ] }
119+ { ...labelProps } >
115120 { label }
116121 { ! ! isRequire && < StarText testID = "test-startText" > *</ StarText > }
117122 </ Title >
118123 ) }
119124 < TouchableContainer
120- style = { inputContainerStyle }
125+ style = { [
126+ StyleSheet . flatten ( TextInputTheme . inputContainerStyle ) ,
127+ StyleSheet . flatten ( inputContainerStyle ) ,
128+ ] }
121129 activeOpacity = { 1 }
122130 onPress = { handleFocus }
123131 disabled = { editable } >
124132 { ! ! leftComponent && leftComponent }
125133 < TextInputComponent
126134 testID = "test-TextInputComponent"
127135 ref = { inputRef }
128- style = { inputStyle }
136+ style = { [ StyleSheet . flatten ( TextInputTheme . inputStyle ) , StyleSheet . flatten ( inputStyle ) ] }
129137 editable = { editable }
130138 multiline = { multiline }
131139 numberOfLines = { numberOfLines }
0 commit comments