From e8587757ced208708311d80838c9b24777f8edbb Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Mon, 29 Jun 2020 16:13:29 -0400
Subject: Created LoginInput Component

---
 src/components/common/LoginInput.tsx | 58 ++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 src/components/common/LoginInput.tsx

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
new file mode 100644
index 00000000..ca33db92
--- /dev/null
+++ b/src/components/common/LoginInput.tsx
@@ -0,0 +1,58 @@
+import React from 'react';
+import {TextInput, StyleSheet} from 'react-native';
+import PropTypes from 'prop-types';
+
+const LoginInput = (props: LoginInputProps) => {
+  return (
+    <TextInput
+      accessibilityLabel={
+        props.isUsername ? 'Username text entry box' : 'Password text entry box'
+      }
+      accessibilityHint={
+        props.isUsername
+          ? 'Enter your tagg username here'
+          : 'Enter your tagg password here'
+      }
+      style={styles.credentials}
+      placeholder={props.isUsername ? 'Username' : 'Password'}
+      placeholderTextColor="#FFFFFF"
+      autoCompleteType={props.isUsername ? 'username' : 'password'}
+      textContentType={props.isUsername ? 'username' : 'password'}
+      returnKeyType={props.isUsername ? 'next' : 'go'}
+      keyboardType={props.isUsername ? 'ascii-capable' : 'default'}
+      onChangeText={(input) => props.onChangeText(input)}
+      defaultValue={props.type}
+      onSubmitEditing={props.onSubmitEditing}
+      blurOnSubmit={props.isUsername ? false : undefined}
+      //   ref={props.isUsername ? undefined : useRef()}
+      secureTextEntry={props.isUsername ? false : true}
+      focus={props.isUsername ? undefined : props.focusPasswordInput}
+    />
+  );
+};
+
+const styles = StyleSheet.create({
+  credentials: {
+    top: 190,
+    width: 248,
+    height: 40,
+    fontSize: 20,
+    color: '#FFFFFF',
+    borderColor: '#FFFDFD',
+    borderWidth: 2,
+    borderRadius: 20,
+    paddingLeft: 13,
+    marginVertical: 15,
+  },
+});
+
+LoginInput.propTypes = {
+  type: PropTypes.string.isRequired,
+  isUsername: PropTypes.bool.isRequired,
+  onChangeText: PropTypes.func.isRequired,
+  onSubmitEditing: PropTypes.func,
+  ref: PropTypes.any,
+  focusPasswordInput: PropTypes.bool,
+};
+
+export default LoginInput;
-- 
cgit v1.2.3-70-g09d2


From 94f966fb947262405130488cbe84cabfc2989fb2 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Mon, 29 Jun 2020 16:25:14 -0400
Subject: Removed TextInput focus code for now

Also miscellaneous code cleanup
---
 src/components/common/LoginInput.tsx |  4 ++--
 src/screens/Login.tsx                | 19 ++++++++-----------
 2 files changed, 10 insertions(+), 13 deletions(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index ca33db92..55d2e662 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -26,7 +26,7 @@ const LoginInput = (props: LoginInputProps) => {
       blurOnSubmit={props.isUsername ? false : undefined}
       //   ref={props.isUsername ? undefined : useRef()}
       secureTextEntry={props.isUsername ? false : true}
-      focus={props.isUsername ? undefined : props.focusPasswordInput}
+    //   focus={props.isUsername ? undefined : props.focusPasswordInput}
     />
   );
 };
@@ -51,7 +51,7 @@ LoginInput.propTypes = {
   isUsername: PropTypes.bool.isRequired,
   onChangeText: PropTypes.func.isRequired,
   onSubmitEditing: PropTypes.func,
-  ref: PropTypes.any,
+//   ref: PropTypes.any,
   focusPasswordInput: PropTypes.bool,
 };
 
diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx
index 2b4a10dc..e7778f1d 100644
--- a/src/screens/Login.tsx
+++ b/src/screens/Login.tsx
@@ -87,11 +87,15 @@ const Login = ({navigation}: LoginProps) => {
     }
   };
 
+  /*
+    Handler for the submit button on the Username keyboard
+  */
   const handleUsernameSubmit = () => {
-    setData({
-      ...data,
-      focusPasswordInput: true,
-    });
+    // setData({
+    //   ...data,
+    //   focusPasswordInput: true,
+    // });
+    Alert.alert("Coming soon 🚧")
   };
 
   return (
@@ -164,13 +168,6 @@ const Login = ({navigation}: LoginProps) => {
         </LinearGradient>
       </View>
     </>
-    // <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
-    //   <Text style={{fontSize: 18}}>Welcome to Tagg! Login page goes here.</Text>
-    //   <Button
-    //     title="Register"
-    //     onPress={() => navigation.navigate('Registration')}
-    //   />
-    // </View>
   );
 };
 
-- 
cgit v1.2.3-70-g09d2


From 8f478fa2e1d4d2b1361a575bd80a928038741ee9 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Mon, 29 Jun 2020 18:56:48 -0400
Subject: Added isPassword prop to LoginInput.tsx

---
 src/components/common/LoginInput.tsx | 45 +++++++++++++++++++++++++++---------
 src/screens/Login.tsx                |  8 +++----
 2 files changed, 38 insertions(+), 15 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 (
     <TextInput
       accessibilityLabel={
-        props.isUsername ? 'Username text entry box' : 'Password text entry box'
+        props.isUsername
+          ? 'Username text entry box'
+          : props.isPassword
+          ? 'Password text entry box'
+          : undefined
       }
       accessibilityHint={
         props.isUsername
           ? 'Enter your tagg username here'
-          : 'Enter your tagg password here'
+          : props.isPassword
+          ? 'Enter your tagg password here'
+          : undefined
       }
       style={styles.credentials}
       placeholder={props.isUsername ? 'Username' : 'Password'}
       placeholderTextColor="#FFFFFF"
-      autoCompleteType={props.isUsername ? 'username' : 'password'}
-      textContentType={props.isUsername ? 'username' : 'password'}
-      returnKeyType={props.isUsername ? 'next' : 'go'}
-      keyboardType={props.isUsername ? 'ascii-capable' : 'default'}
+      autoCompleteType={
+        props.isUsername ? 'username' : props.isPassword ? 'password' : 'off'
+      }
+      textContentType={
+        props.isUsername ? 'username' : props.isPassword ? 'password' : 'none'
+      }
+      returnKeyType={
+        props.isUsername ? 'next' : props.isPassword ? 'go' : 'default'
+      }
+      keyboardType={
+        props.isUsername
+          ? 'ascii-capable'
+          : props.isPassword
+          ? 'default'
+          : 'default'
+      }
       onChangeText={(input) => 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,
 };
 
diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx
index e7778f1d..f7445018 100644
--- a/src/screens/Login.tsx
+++ b/src/screens/Login.tsx
@@ -37,7 +37,7 @@ const Login = ({navigation}: LoginProps) => {
     Updates the state of username. Also verifies the input of the Username field.
   */
   const handleUsernameUpdate = (val: string) => {
-    var validLength: boolean = val.trim().length >= 6;
+    let validLength: boolean = val.trim().length >= 6;
 
     if (validLength) {
       setData({
@@ -58,7 +58,7 @@ const Login = ({navigation}: LoginProps) => {
     Updates the state of password. Also verifies the input of the Password field.
   */
   const handlePasswordUpdate = (val: string) => {
-    var validLength: boolean = val.trim().length >= 8;
+    let validLength: boolean = val.trim().length >= 8;
 
     if (validLength) {
       setData({
@@ -95,7 +95,7 @@ const Login = ({navigation}: LoginProps) => {
     //   ...data,
     //   focusPasswordInput: true,
     // });
-    Alert.alert("Coming soon 🚧")
+    Alert.alert('Coming soon 🚧');
   };
 
   return (
@@ -125,7 +125,7 @@ const Login = ({navigation}: LoginProps) => {
           )}
           <LoginInput
             type={data.password}
-            isUsername={false}
+            isPassword={true}
             onChangeText={(user) => handlePasswordUpdate(user)}
             focusPasswordInput={data.focusPasswordInput}
             onSubmitEditing={() => handleLogin()}
-- 
cgit v1.2.3-70-g09d2


From 56d51741cfcbfae55fc40a29e5d4a8112f9c8e6b Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Mon, 29 Jun 2020 18:58:22 -0400
Subject: Forgot to update to the placeholder 😅
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/components/common/LoginInput.tsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index dae3241c..e0d2118a 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -20,7 +20,13 @@ const LoginInput = (props: LoginInputProps) => {
           : undefined
       }
       style={styles.credentials}
-      placeholder={props.isUsername ? 'Username' : 'Password'}
+      placeholder={
+        props.isUsername
+          ? 'Username'
+          : props.isPassword
+          ? 'Password'
+          : undefined
+      }
       placeholderTextColor="#FFFFFF"
       autoCompleteType={
         props.isUsername ? 'username' : props.isPassword ? 'password' : 'off'
-- 
cgit v1.2.3-70-g09d2


From e1d09e0fe3774e0f777b828e529a92b7cc5791f5 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Mon, 29 Jun 2020 19:00:20 -0400
Subject: Undefined keyboardType if unknown situation

---
 src/components/common/LoginInput.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index e0d2118a..12bf0b3c 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -42,7 +42,7 @@ const LoginInput = (props: LoginInputProps) => {
           ? 'ascii-capable'
           : props.isPassword
           ? 'default'
-          : 'default'
+          : undefined
       }
       onChangeText={(input) => props.onChangeText(input)}
       defaultValue={props.type}
-- 
cgit v1.2.3-70-g09d2


From ff9dba9a4241a799970ef36866b595d6f6940531 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Mon, 29 Jun 2020 19:36:50 -0400
Subject: Added validationWarnings to LoginInput component

---
 src/components/common/LoginInput.tsx | 117 +++++++++++++++++++----------------
 src/screens/Login.tsx                |  14 ++---
 2 files changed, 68 insertions(+), 63 deletions(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index 12bf0b3c..ba519480 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -1,61 +1,66 @@
 import React from 'react';
-import {TextInput, StyleSheet} from 'react-native';
+import {Text, TextInput, StyleSheet} from 'react-native';
 import PropTypes from 'prop-types';
 
 const LoginInput = (props: LoginInputProps) => {
   return (
-    <TextInput
-      accessibilityLabel={
-        props.isUsername
-          ? 'Username text entry box'
-          : props.isPassword
-          ? 'Password text entry box'
-          : undefined
-      }
-      accessibilityHint={
-        props.isUsername
-          ? 'Enter your tagg username here'
-          : props.isPassword
-          ? 'Enter your tagg password here'
-          : undefined
-      }
-      style={styles.credentials}
-      placeholder={
-        props.isUsername
-          ? 'Username'
-          : props.isPassword
-          ? 'Password'
-          : undefined
-      }
-      placeholderTextColor="#FFFFFF"
-      autoCompleteType={
-        props.isUsername ? 'username' : props.isPassword ? 'password' : 'off'
-      }
-      textContentType={
-        props.isUsername ? 'username' : props.isPassword ? 'password' : 'none'
-      }
-      returnKeyType={
-        props.isUsername ? 'next' : props.isPassword ? 'go' : 'default'
-      }
-      keyboardType={
-        props.isUsername
-          ? 'ascii-capable'
-          : props.isPassword
-          ? 'default'
-          : undefined
-      }
-      onChangeText={(input) => props.onChangeText(input)}
-      defaultValue={props.type}
-      onSubmitEditing={props.onSubmitEditing}
-      blurOnSubmit={
-        props.isUsername ? false : props.isPassword ? undefined : undefined
-      }
-      //   ref={props.isUsername ? undefined : useRef()}
-      secureTextEntry={
-        props.isUsername ? false : props.isPassword ? true : false
-      }
-      //   focus={props.isUsername ? undefined : props.focusPasswordInput}
-    />
+    <>
+      <TextInput
+        accessibilityLabel={
+          props.isUsername
+            ? 'Username text entry box'
+            : props.isPassword
+            ? 'Password text entry box'
+            : undefined
+        }
+        accessibilityHint={
+          props.isUsername
+            ? 'Enter your tagg username here'
+            : props.isPassword
+            ? 'Enter your tagg password here'
+            : undefined
+        }
+        style={styles.credentials}
+        placeholder={
+          props.isUsername
+            ? 'Username'
+            : props.isPassword
+            ? 'Password'
+            : undefined
+        }
+        placeholderTextColor="#FFFFFF"
+        autoCompleteType={
+          props.isUsername ? 'username' : props.isPassword ? 'password' : 'off'
+        }
+        textContentType={
+          props.isUsername ? 'username' : props.isPassword ? 'password' : 'none'
+        }
+        returnKeyType={
+          props.isUsername ? 'next' : props.isPassword ? 'go' : 'default'
+        }
+        keyboardType={
+          props.isUsername
+            ? 'ascii-capable'
+            : props.isPassword
+            ? 'default'
+            : undefined
+        }
+        onChangeText={(input) => props.onChangeText(input)}
+        defaultValue={props.type}
+        onSubmitEditing={props.onSubmitEditing}
+        blurOnSubmit={
+          props.isUsername ? false : props.isPassword ? undefined : undefined
+        }
+        //   ref={props.isUsername ? undefined : useRef()}
+        secureTextEntry={
+          props.isUsername ? false : props.isPassword ? true : false
+        }
+        //   focus={props.isUsername ? undefined : props.focusPasswordInput}
+      />
+      {!props.isValid && (
+        <Text style={styles.invalidCredentials}>{props.validationWarning}</Text>
+      )}
+    </>
   );
 };
 
@@ -72,6 +77,10 @@ const styles = StyleSheet.create({
     paddingLeft: 13,
     marginVertical: 15,
   },
+  invalidCredentials: {
+    top: 180,
+    color: '#F4DDFF',
+  },
 });
 
 LoginInput.propTypes = {
@@ -82,6 +91,8 @@ LoginInput.propTypes = {
   onSubmitEditing: PropTypes.func,
   //   ref: PropTypes.any,
   focusPasswordInput: PropTypes.bool,
+  isValid: PropTypes.bool,
+  validationWarning: PropTypes.string,
 };
 
 export default LoginInput;
diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx
index 618507d8..77bc1b61 100644
--- a/src/screens/Login.tsx
+++ b/src/screens/Login.tsx
@@ -117,24 +117,18 @@ const Login = ({navigation}: LoginProps) => {
             isUsername={true}
             onChangeText={(user) => handleUsernameUpdate(user)}
             onSubmitEditing={() => handleUsernameSubmit()}
+            isValid={data.isValidUser}
+            validationWarning={'Username must be at least 6 characters long.'}
           />
-          {data.isValidUser ? null : (
-            <Text style={styles.invalidCredentials}>
-              Username must be at least 6 characters long.
-            </Text>
-          )}
           <LoginInput
             type={data.password}
             isPassword={true}
             onChangeText={(user) => handlePasswordUpdate(user)}
             focusPasswordInput={data.focusPasswordInput}
             onSubmitEditing={() => handleLogin()}
+            isValid={data.isValidPassword}
+            validationWarning={'Password must be at least 8 characters long.'}
           />
-          {data.isValidPassword ? null : (
-            <Text style={styles.invalidCredentials}>
-              Password must be at least 8 characters long.
-            </Text>
-          )}
           <TouchableOpacity
             accessibilityLabel="Forgot password button"
             accessibilityHint="Select this if you forgot your tagg password"
-- 
cgit v1.2.3-70-g09d2


From 4bf146fcdb29ba4424d24f63d8809ee830112d68 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Mon, 29 Jun 2020 19:47:19 -0400
Subject: Updated, props to use interface

---
 src/components/common/LoginInput.tsx | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index ba519480..fac8a04f 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -83,16 +83,16 @@ const styles = StyleSheet.create({
   },
 });
 
-LoginInput.propTypes = {
-  type: PropTypes.string.isRequired,
-  isUsername: PropTypes.bool,
-  isPassword: PropTypes.bool,
-  onChangeText: PropTypes.func.isRequired,
-  onSubmitEditing: PropTypes.func,
+interface LoginInputProps {
+  type: string
+  isUsername?: boolean
+  isPassword?: boolean
+  onChangeText: any
+  onSubmitEditing?: any
   //   ref: PropTypes.any,
-  focusPasswordInput: PropTypes.bool,
-  isValid: PropTypes.bool,
-  validationWarning: PropTypes.string,
-};
+  focusPasswordInput?: boolean
+  isValid?: boolean
+  validationWarning?: string
+}
 
 export default LoginInput;
-- 
cgit v1.2.3-70-g09d2


From 06e351f3e298ee3802e1cfb9d65fd456279e8a8a Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Mon, 29 Jun 2020 19:48:40 -0400
Subject: Removed PropTypes import

---
 src/components/common/LoginInput.tsx | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index fac8a04f..0ed41824 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -1,6 +1,5 @@
 import React from 'react';
 import {Text, TextInput, StyleSheet} from 'react-native';
-import PropTypes from 'prop-types';
 
 const LoginInput = (props: LoginInputProps) => {
   return (
@@ -84,15 +83,15 @@ const styles = StyleSheet.create({
 });
 
 interface LoginInputProps {
-  type: string
-  isUsername?: boolean
-  isPassword?: boolean
-  onChangeText: any
-  onSubmitEditing?: any
+  type: string;
+  isUsername?: boolean;
+  isPassword?: boolean;
+  onChangeText: any;
+  onSubmitEditing?: any;
   //   ref: PropTypes.any,
-  focusPasswordInput?: boolean
-  isValid?: boolean
-  validationWarning?: string
+  focusPasswordInput?: boolean;
+  isValid?: boolean;
+  validationWarning?: string;
 }
 
 export default LoginInput;
-- 
cgit v1.2.3-70-g09d2


From a6e39f11f4cc0142bdfa9a7e14159a76235a5f84 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Tue, 30 Jun 2020 08:37:50 -0400
Subject: Updated function props to be functions

---
 src/components/common/LoginInput.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index 0ed41824..43c31e2b 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -86,8 +86,8 @@ interface LoginInputProps {
   type: string;
   isUsername?: boolean;
   isPassword?: boolean;
-  onChangeText: any;
-  onSubmitEditing?: any;
+  onChangeText: (input: string) => void;
+  onSubmitEditing?: () => void;
   //   ref: PropTypes.any,
   focusPasswordInput?: boolean;
   isValid?: boolean;
-- 
cgit v1.2.3-70-g09d2


From 81d076c5fae1bedb564d3ec3733431dec848bf56 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Tue, 30 Jun 2020 10:49:50 -0400
Subject: Made registration start after Get Started button

---
 src/components/common/LoginInput.tsx |  4 ++--
 src/screens/Login.tsx                | 13 +++++++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index 43c31e2b..c82682d7 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -54,7 +54,7 @@ const LoginInput = (props: LoginInputProps) => {
         secureTextEntry={
           props.isUsername ? false : props.isPassword ? true : false
         }
-        //   focus={props.isUsername ? undefined : props.focusPasswordInput}
+        // ref={props.ref}
       />
       {!props.isValid && (
         <Text style={styles.invalidCredentials}>{props.validationWarning}</Text>
@@ -88,7 +88,7 @@ interface LoginInputProps {
   isPassword?: boolean;
   onChangeText: (input: string) => void;
   onSubmitEditing?: () => void;
-  //   ref: PropTypes.any,
+  // ref?: string;
   focusPasswordInput?: boolean;
   isValid?: boolean;
   validationWarning?: string;
diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx
index c6f23c03..6384eff1 100644
--- a/src/screens/Login.tsx
+++ b/src/screens/Login.tsx
@@ -25,6 +25,7 @@ interface LoginProps {
   route: LoginScreenRouteProp;
   navigation: LoginScreenNavigationProp;
 }
+
 const Login = ({navigation}: LoginProps) => {
   // const passwordInput = useRef();
   const [data, setData] = React.useState({
@@ -85,7 +86,6 @@ const Login = ({navigation}: LoginProps) => {
       Alert.alert(
         `My favorite Girl Scout Cookies are taggalongs! What are yours ${data.username}?`,
       );
-      navigation.navigate('Registration');
     }
   };
 
@@ -98,8 +98,13 @@ const Login = ({navigation}: LoginProps) => {
     //   focusPasswordInput: true,
     // });
     Alert.alert('Coming soon 🚧');
+    // refs.password_input.focus()
   };
 
+  const handleRegistration = () => {
+    navigation.navigate('Registration');
+  }
+
   return (
     <>
       <StatusBar barStyle="light-content" />
@@ -125,6 +130,7 @@ const Login = ({navigation}: LoginProps) => {
               onSubmitEditing={() => handleUsernameSubmit()}
               isValid={data.isValidUser}
               validationWarning={'Username must be at least 6 characters long.'}
+              // ref={'username_input'}
             />
             <LoginInput
               type={data.password}
@@ -134,6 +140,7 @@ const Login = ({navigation}: LoginProps) => {
               onSubmitEditing={() => handleLogin()}
               isValid={data.isValidPassword}
               validationWarning={'Password must be at least 8 characters long.'}
+              // ref={'password_input'}
             />
             <TouchableOpacity
               accessibilityLabel="Forgot password button"
@@ -159,9 +166,7 @@ const Login = ({navigation}: LoginProps) => {
                 accessibilityLabel="Get started"
                 accessibilityHint="Select this if you do not have a tagg account"
                 style={styles.getStarted}
-                onPress={() =>
-                  Alert.alert('I get the tagg flip it and tumble it.')
-                }>
+                onPress={() => handleRegistration()}>
                 Get started!
               </Text>
             </Text>
-- 
cgit v1.2.3-70-g09d2


From b5da6e55ccd4109eb1aa7705540ffb0b4a30a805 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Tue, 30 Jun 2020 16:23:24 -0400
Subject: Next button on keyboard works again!

---
 src/components/common/LoginInput.tsx |  5 ++---
 src/screens/Login.tsx                | 14 ++++----------
 2 files changed, 6 insertions(+), 13 deletions(-)

(limited to 'src/components/common/LoginInput.tsx')

diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx
index c82682d7..e4d6b957 100644
--- a/src/components/common/LoginInput.tsx
+++ b/src/components/common/LoginInput.tsx
@@ -50,11 +50,10 @@ const LoginInput = (props: LoginInputProps) => {
         blurOnSubmit={
           props.isUsername ? false : props.isPassword ? undefined : undefined
         }
-        //   ref={props.isUsername ? undefined : useRef()}
         secureTextEntry={
           props.isUsername ? false : props.isPassword ? true : false
         }
-        // ref={props.ref}
+        ref={props.input_ref}
       />
       {!props.isValid && (
         <Text style={styles.invalidCredentials}>{props.validationWarning}</Text>
@@ -88,7 +87,7 @@ interface LoginInputProps {
   isPassword?: boolean;
   onChangeText: (input: string) => void;
   onSubmitEditing?: () => void;
-  // ref?: string;
+  input_ref?: object;
   focusPasswordInput?: boolean;
   isValid?: boolean;
   validationWarning?: string;
diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx
index 6384eff1..417d9bd7 100644
--- a/src/screens/Login.tsx
+++ b/src/screens/Login.tsx
@@ -27,7 +27,7 @@ interface LoginProps {
 }
 
 const Login = ({navigation}: LoginProps) => {
-  // const passwordInput = useRef();
+  const input_ref = React.createRef();
   const [data, setData] = React.useState({
     username: '',
     password: '',
@@ -93,17 +93,12 @@ const Login = ({navigation}: LoginProps) => {
     Handler for the submit button on the Username keyboard
   */
   const handleUsernameSubmit = () => {
-    // setData({
-    //   ...data,
-    //   focusPasswordInput: true,
-    // });
-    Alert.alert('Coming soon 🚧');
-    // refs.password_input.focus()
+    input_ref.current.focus();
   };
 
   const handleRegistration = () => {
     navigation.navigate('Registration');
-  }
+  };
 
   return (
     <>
@@ -130,7 +125,6 @@ const Login = ({navigation}: LoginProps) => {
               onSubmitEditing={() => handleUsernameSubmit()}
               isValid={data.isValidUser}
               validationWarning={'Username must be at least 6 characters long.'}
-              // ref={'username_input'}
             />
             <LoginInput
               type={data.password}
@@ -140,7 +134,7 @@ const Login = ({navigation}: LoginProps) => {
               onSubmitEditing={() => handleLogin()}
               isValid={data.isValidPassword}
               validationWarning={'Password must be at least 8 characters long.'}
-              // ref={'password_input'}
+              input_ref={input_ref}
             />
             <TouchableOpacity
               accessibilityLabel="Forgot password button"
-- 
cgit v1.2.3-70-g09d2

