diff --git a/js/config/helpers.js b/js/config/helpers.js index 9919469..49c45c4 100644 --- a/js/config/helpers.js +++ b/js/config/helpers.js @@ -1,4 +1,4 @@ -import {Platform, ImagePickerIOS} from 'react-native'; +import { Platform, ImagePickerIOS } from 'react-native'; import RNFetchBlob from 'react-native-fetch-blob' import firebase from 'firebase'; import { auth, betadb, betaevents, betatalks, betaquestions, betausers, betastorage } from './firebase'; @@ -7,13 +7,13 @@ const Blob = RNFetchBlob.polyfill.Blob const fs = RNFetchBlob.fs window.XMLHttpRequest = RNFetchBlob.polyfill.XMLHttpRequest window.Blob = Blob + //users const user = { //input format for initial signup form; email: 'test@pest.com', password: 'password', name: 'Firstname Lastname' } - //login/logout export function login(profile) { return auth.signInWithEmailAndPassword(profile.email, profile.password) @@ -40,11 +40,11 @@ export async function signUp(profile) { //update function updateEmail(user, email) { if(email) { - return user.updateEmail(email) - .then(()=>updateEmailField(user.uid, email)) - .catch(function (error) { - console.log(error) - }); + return user.updateEmail(email) + .then(()=>updateEmailField(user.uid, email)) + .catch(function (error) { + console.log(error) + }); } else { console.log('empty email') } @@ -65,9 +65,9 @@ function updateFullname(user, name) { function updatePass(user, password) { if(password) { user.updatePassword(password) - .catch(function (error) { - console.log(error) - }); + .catch(function (error) { + console.log(error) + }); } else { console.log('empty pass') } diff --git a/js/scenes/Profile/Profile.js b/js/scenes/Profile/Profile.js index f655bdb..1b39b46 100644 --- a/js/scenes/Profile/Profile.js +++ b/js/scenes/Profile/Profile.js @@ -37,41 +37,43 @@ const Profile = ({ updateProfile, user, handleImageUpload, imageUrl, handleBio, handleBio(text)} - value={bioField || handleBio(user.bio)} + value={bioField} multiline={true} maxLength={100} - placeholder="Personal bio" + placeholder={user.bio} /> - Things you're working on + Goal One handleGoals(text, "goalOne")} - value={goalsField.goalOne || handleGoals(user.goals.goalOne, "goalOne")} + value={goalsField.goalOne} multiline={true} maxLength={100} - placeholder="Goal #1" + placeholder={user.goals.goalOne} /> + Goal Two handleGoals(text, "goalTwo")} - value={goalsField.goalTwo || handleGoals(user.goals.goalTwo, "goalTwo")} + value={goalsField.goalTwo} multiline={true} maxLength={100} - placeholder="Goal #2" + placeholder={user.goals.goalTwo} /> + Goal Three handleGoals(text, "goalThree")} - value={goalsField.goalThree || handleGoals(user.goals.goalThree, "goalThree")} + value={goalsField.goalThree} multiline={true} maxLength={100} - placeholder="Goal #3" + placeholder={user.goals.goalThree} /> Facebook @@ -81,8 +83,8 @@ const Profile = ({ updateProfile, user, handleImageUpload, imageUrl, handleBio, autoCorrect={false} autoCapitalize="none" onChangeText={(text) => handleSocialMedia(text, "facebook")} - value={socialMedia.facebook || handleSocialMedia(user.socialMediaUrls.facebook, "facebook")} - placeholder="Facebook" + value={socialMedia.facebook} + placeholder={user.socialMediaUrls.facebook} /> Twitter @@ -92,8 +94,8 @@ const Profile = ({ updateProfile, user, handleImageUpload, imageUrl, handleBio, autoCorrect={false} autoCapitalize="none" onChangeText={(text) => handleSocialMedia(text, "twitter")} - value={socialMedia.twitter || handleSocialMedia(user.socialMediaUrls.twitter, "twitter")} - placeholder="Twitter" + value={socialMedia.twitter} + placeholder={user.socialMediaUrls.twitter} /> LinkedIn @@ -103,8 +105,8 @@ const Profile = ({ updateProfile, user, handleImageUpload, imageUrl, handleBio, autoCorrect={false} autoCapitalize="none" onChangeText={(text) => handleSocialMedia(text, "linkedIn")} - value={socialMedia.linkedIn || handleSocialMedia(user.socialMediaUrls.linkedIn, "linkedIn")} - placeholder="LinkedIn" + value={socialMedia.linkedIn} + placeholder={user.socialMediaUrls.linkedIn} />