From c4e76811cae6cf14d5cc8daed9317f808087ed77 Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Tue, 20 Apr 2021 17:49:38 -0400
Subject: linted

---
 src/screens/profile/EditProfile.tsx | 78 ++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 41 deletions(-)

(limited to 'src/screens/profile/EditProfile.tsx')

diff --git a/src/screens/profile/EditProfile.tsx b/src/screens/profile/EditProfile.tsx
index 8b658043..36abb146 100644
--- a/src/screens/profile/EditProfile.tsx
+++ b/src/screens/profile/EditProfile.tsx
@@ -199,12 +199,12 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
   /*
    * Handles changes to the website field value and verifies the input by updating state and running a validation function.
    */
-  const handleWebsiteUpdate = (website: string) => {
-    website = website.trim();
-    let isValidWebsite: boolean = websiteRegex.test(website);
+  const handleWebsiteUpdate = (newWebsite: string) => {
+    newWebsite = newWebsite.trim();
+    let isValidWebsite: boolean = websiteRegex.test(newWebsite);
     setForm({
       ...form,
-      website,
+      website: newWebsite,
       isValidWebsite,
     });
   };
@@ -212,27 +212,27 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
   /*
    * Handles changes to the bio field value and verifies the input by updating state and running a validation function.
    */
-  const handleBioUpdate = (bio: string) => {
-    let isValidBio: boolean = bioRegex.test(bio);
+  const handleBioUpdate = (newBio: string) => {
+    let isValidBio: boolean = bioRegex.test(newBio);
     setForm({
       ...form,
-      bio,
+      bio: newBio,
       isValidBio,
     });
   };
 
-  const handleGenderUpdate = (gender: string) => {
-    if (gender === 'custom') {
-      setForm({...form, gender});
+  const handleGenderUpdate = (newGender: string) => {
+    if (newGender === 'custom') {
+      setForm({...form, gender: newGender});
       setIsCustomGender(true);
-    } else if (gender === null) {
+    } else if (newGender === null) {
       // not doing anything will make the picker "bounce back"
     } else {
       setIsCustomGender(false);
       let isValidGender: boolean = true;
       setForm({
         ...form,
-        gender,
+        gender: newGender,
         isValidGender,
       });
     }
@@ -383,8 +383,8 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
       headerRight: () => (
         <Button
           title={'Save'}
-          buttonStyle={{backgroundColor: 'transparent', marginRight: 15}}
-          titleStyle={{fontWeight: 'bold'}}
+          buttonStyle={styles.headerRightButton}
+          titleStyle={styles.boldFont}
           onPress={() => {
             setLoading(true);
             handleSubmit().then(() => setLoading(false));
@@ -409,22 +409,13 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
             alwaysBounceVertical
             contentContainerStyle={{paddingBottom: SCREEN_HEIGHT / 15}}>
             <StatusBar barStyle="light-content" translucent={false} />
-            <View
-              style={{
-                position: 'relative',
-                alignSelf: 'center',
-              }}>
+            <View style={styles.relativeCenter}>
               <View>
                 <View style={styles.profile}>
                   <LargeProfilePic />
                   <SmallProfilePic />
                 </View>
-                <View
-                  style={{
-                    position: 'relative',
-                    width: 280,
-                    alignSelf: 'center',
-                  }}>
+                <View style={styles.relativeCenterWithWidth}>
                   <TaggInput
                     accessibilityHint="Enter a website."
                     accessibilityLabel="Website input field."
@@ -540,7 +531,7 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
                       <SocialIcon
                         social={'TikTok'}
                         style={styles.icon}
-                        screenType={ScreenType.Profile}
+                        whiteRing={undefined}
                       />
                       <View style={styles.taggInput}>
                         <TaggInput
@@ -631,20 +622,6 @@ const styles = StyleSheet.create({
     width: 110,
     borderRadius: 55,
   },
-  submitBtn: {
-    backgroundColor: '#8F01FF',
-    justifyContent: 'center',
-    alignItems: 'center',
-    width: 150,
-    height: 40,
-    borderRadius: 5,
-    marginTop: '5%',
-  },
-  submitBtnLabel: {
-    fontSize: 16,
-    fontWeight: '500',
-    color: '#fff',
-  },
   customGenderInput: {
     width: '100%',
     height: 40,
@@ -666,7 +643,26 @@ const styles = StyleSheet.create({
     aspectRatio: 1,
     flex: 1,
   },
-  taggInput: {flex: 6.5, marginLeft: '3%'},
+  taggInput: {
+    flex: 6.5,
+    marginLeft: '3%',
+  },
+  headerRightButton: {
+    backgroundColor: 'transparent',
+    marginRight: 15,
+  },
+  boldFont: {
+    fontWeight: 'bold',
+  },
+  relativeCenter: {
+    position: 'relative',
+    alignSelf: 'center',
+  },
+  relativeCenterWithWidth: {
+    position: 'relative',
+    width: 280,
+    alignSelf: 'center',
+  },
 });
 
 export default EditProfile;
-- 
cgit v1.2.3-70-g09d2

