@teamnhz/rn-ui-toolkit 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -41,6 +41,10 @@ interface InputProps extends TextInputProps {
|
|
|
41
41
|
flagIcon?: string;
|
|
42
42
|
flagIconStyle?: object;
|
|
43
43
|
flagContainerStyle?: object;
|
|
44
|
+
iconTintColor?: string;
|
|
45
|
+
leftIconTintColor?: string;
|
|
46
|
+
rightIconTintColor?: string;
|
|
47
|
+
downArrowTintColor?: string;
|
|
44
48
|
}
|
|
45
49
|
declare const Input: React.FC<InputProps>;
|
|
46
50
|
export default Input;
|
|
@@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next";
|
|
|
4
4
|
import { Colors, Typography, Scale, Images } from "../../styles";
|
|
5
5
|
import { defaultRegex } from "../../utils/regex";
|
|
6
6
|
import { messages } from "../../constants/messages";
|
|
7
|
-
const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, leftIcon, rightIcon, onLeftIconPress, onRightIconPress, style, containerStyle, inputStyle, errorTextStyle, leftIconStyle, rightIconStyle, leftIconWrapperStyle, rightIconWrapperStyle, type = "text", editable = true, error, value = "", customRegex, customErrorMessage, onChangeText, onValidation, onBlur: restOnBlur, onFocus: restOnFocus, multiline = false, maxLength, returnKeyType, countryCode, onPressCountryCode, countryCodeTextStyle, countryCodeWrapperStyle, isError = true, downArrowIcon, downArrowStyle, flagIcon, flagIconStyle, flagContainerStyle, ...rest }) => {
|
|
7
|
+
const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, leftIcon, rightIcon, onLeftIconPress, onRightIconPress, style, containerStyle, inputStyle, errorTextStyle, leftIconStyle, rightIconStyle, leftIconWrapperStyle, rightIconWrapperStyle, type = "text", editable = true, error, value = "", customRegex, customErrorMessage, onChangeText, onValidation, onBlur: restOnBlur, onFocus: restOnFocus, multiline = false, maxLength, returnKeyType, countryCode, onPressCountryCode, countryCodeTextStyle, countryCodeWrapperStyle, isError = true, downArrowIcon, downArrowStyle, flagIcon, flagIconStyle, flagContainerStyle, iconTintColor, leftIconTintColor, rightIconTintColor, downArrowTintColor, ...rest }) => {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
9
|
const [secureText, setSecureText] = useState(type === "password");
|
|
10
10
|
const [internalError, setInternalError] = useState(null);
|
|
@@ -83,7 +83,7 @@ const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, left
|
|
|
83
83
|
multiline && styles.multilineContainer,
|
|
84
84
|
] },
|
|
85
85
|
leftIcon && (React.createElement(TouchableOpacity, { onPress: onLeftIconPress, disabled: !onLeftIconPress, style: [styles.iconWrapper, leftIconWrapperStyle] },
|
|
86
|
-
React.createElement(Image, { source: leftIcon, style: [styles.icon, leftIconStyle], resizeMode: "contain" }))),
|
|
86
|
+
React.createElement(Image, { source: leftIcon, style: [styles.icon, { tintColor: leftIconTintColor || iconTintColor || Colors.primaryColor }, leftIconStyle], resizeMode: "contain" }))),
|
|
87
87
|
flagIcon && countryCode && (React.createElement(TouchableOpacity, { onPress: onLeftIconPress, disabled: !onLeftIconPress, style: [
|
|
88
88
|
styles.iconWrapper,
|
|
89
89
|
{
|
|
@@ -114,8 +114,8 @@ const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, left
|
|
|
114
114
|
? inputPlaceholderTextColor
|
|
115
115
|
: Colors.textGrey, editable: editable, secureTextEntry: secureText, keyboardType: keyboardType, value: value, onChangeText: handleChangeText, onFocus: handleFocus, onBlur: handleBlur, multiline: multiline, maxLength: maxLength, returnKeyType: returnKeyType, ...rest }),
|
|
116
116
|
type === "password" && !rightIcon ? (React.createElement(TouchableOpacity, { onPress: () => setSecureText(!secureText), style: [styles.iconWrapper, rightIconWrapperStyle] },
|
|
117
|
-
React.createElement(Image, { source: secureText ? Images.Eyeoff : Images.Eyeon, style: [styles.icon, rightIconStyle], resizeMode: "contain" }))) : (rightIcon && (React.createElement(TouchableOpacity, { onPress: onRightIconPress, disabled: !onRightIconPress, style: [styles.iconWrapper, rightIconWrapperStyle] },
|
|
118
|
-
React.createElement(Image, { source: rightIcon, style: [styles.icon, rightIconStyle], resizeMode: "contain" }))))),
|
|
117
|
+
React.createElement(Image, { source: secureText ? Images.Eyeoff : Images.Eyeon, style: [styles.icon, { tintColor: rightIconTintColor || iconTintColor || Colors.primaryColor }, rightIconStyle], resizeMode: "contain" }))) : (rightIcon && (React.createElement(TouchableOpacity, { onPress: onRightIconPress, disabled: !onRightIconPress, style: [styles.iconWrapper, rightIconWrapperStyle] },
|
|
118
|
+
React.createElement(Image, { source: rightIcon, style: [styles.icon, { tintColor: rightIconTintColor || iconTintColor || Colors.primaryColor }, rightIconStyle], resizeMode: "contain" }))))),
|
|
119
119
|
showError && isError && (React.createElement(Text, { style: [styles.errorText, errorTextStyle] }, showError))));
|
|
120
120
|
};
|
|
121
121
|
export default Input;
|