From c4e76811cae6cf14d5cc8daed9317f808087ed77 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 20 Apr 2021 17:49:38 -0400 Subject: linted --- src/screens/profile/EditProfile.tsx | 78 +++++++++++++++----------------- src/screens/profile/SocialMediaTaggs.tsx | 38 ++++++---------- 2 files changed, 52 insertions(+), 64 deletions(-) (limited to 'src/screens/profile') 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 = ({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 = ({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 = ({route, navigation}) => { headerRight: () => (