From 2641a70628b1ccc96e4bce0703f67dbb6981a64f Mon Sep 17 00:00:00 2001 From: Danish Date: Mon, 3 Feb 2020 16:13:33 +0500 Subject: [PATCH] added toucable opacity to icon --- src/Input.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Input.js b/src/Input.js index eba00ae..f91a80b 100644 --- a/src/Input.js +++ b/src/Input.js @@ -27,6 +27,7 @@ function Input({ iconSize, iconContent, password, + onIconPress, ...rest }) { const [isPassword, setIsPassword] = React.useState(false); @@ -43,7 +44,6 @@ function Input({ style, ]; - const inputStyles = [ styles.inputView, borderless && icon && styles.inputIcon, @@ -52,16 +52,18 @@ function Input({ ]; const iconInstance = icon ? ( - + onIconPress()}> + + ) : ( - iconContent - ); + iconContent + ); const viewPassElement = password && viewPass && ( setIsPassword(!isPassword)}> @@ -152,6 +154,7 @@ Input.propTypes = { iconContent: PropTypes.any, theme: PropTypes.any, onRef: PropTypes.func, + onIconPress: PropTypes.func, }; const styles = theme =>