From 8f478fa2e1d4d2b1361a575bd80a928038741ee9 Mon Sep 17 00:00:00 2001 From: Justin Shillingford Date: Mon, 29 Jun 2020 18:56:48 -0400 Subject: Added isPassword prop to LoginInput.tsx --- src/components/common/LoginInput.tsx | 45 +++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) (limited to 'src/components/common/LoginInput.tsx') diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx index 55d2e662..dae3241c 100644 --- a/src/components/common/LoginInput.tsx +++ b/src/components/common/LoginInput.tsx @@ -6,27 +6,49 @@ const LoginInput = (props: LoginInputProps) => { return ( props.onChangeText(input)} defaultValue={props.type} onSubmitEditing={props.onSubmitEditing} - blurOnSubmit={props.isUsername ? false : undefined} + blurOnSubmit={ + props.isUsername ? false : props.isPassword ? undefined : undefined + } // ref={props.isUsername ? undefined : useRef()} - secureTextEntry={props.isUsername ? false : true} - // focus={props.isUsername ? undefined : props.focusPasswordInput} + secureTextEntry={ + props.isUsername ? false : props.isPassword ? true : false + } + // focus={props.isUsername ? undefined : props.focusPasswordInput} /> ); }; @@ -48,10 +70,11 @@ const styles = StyleSheet.create({ LoginInput.propTypes = { type: PropTypes.string.isRequired, - isUsername: PropTypes.bool.isRequired, + isUsername: PropTypes.bool, + isPassword: PropTypes.bool, onChangeText: PropTypes.func.isRequired, onSubmitEditing: PropTypes.func, -// ref: PropTypes.any, + // ref: PropTypes.any, focusPasswordInput: PropTypes.bool, }; -- cgit v1.2.3-70-g09d2