diff options
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/common.ts | 15 | ||||
| -rw-r--r-- | src/utils/users.ts | 4 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/utils/common.ts b/src/utils/common.ts index 27411149..a2f88e8b 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -3,12 +3,12 @@ import {Linking} from 'react-native'; import {BROWSABLE_SOCIAL_URLS, TOGGLE_BUTTON_TYPE} from '../constants'; export const getToggleButtonText: ( - button_type: string, + buttonType: string, state: boolean, -) => string | null = (button_type, state) => { - switch (button_type) { - case TOGGLE_BUTTON_TYPE.FOLLOW_UNFOLLOW: - return state ? 'Unfollow' : 'Follow'; +) => string | null = (buttonType, state) => { + switch (buttonType) { + case TOGGLE_BUTTON_TYPE.FRIEND_UNFRIEND: + return state ? 'Unfriend' : 'Add Friend'; case TOGGLE_BUTTON_TYPE.BLOCK_UNBLOCK: return state ? 'Unblock' : 'Block'; default: @@ -25,6 +25,11 @@ export const handleOpenSocialUrlOnBrowser = ( } }; +//Returns university class just like we would like to display on profile page +export const getUniversityClass = (universityClass: number) => { + return `Class of ${(universityClass % 2000).toString()}'`; +}; + export const getDateAge: ( date: moment.Moment, ) => 'today' | 'yesterday' | 'thisWeek' | 'unknown' = (date: moment.Moment) => { diff --git a/src/utils/users.ts b/src/utils/users.ts index be92d184..bcb43cbc 100644 --- a/src/utils/users.ts +++ b/src/utils/users.ts @@ -4,7 +4,7 @@ import {loadSocialPosts} from '../services'; import { loadAllSocials, loadBlockedList, - loadFollowData, + loadFriendsData, loadRecentlySearched, loadUserData, loadUserMoments, @@ -21,7 +21,7 @@ import {ScreenType, UserType} from './../types/types'; const loadData = async (dispatch: AppDispatch, user: UserType) => { await Promise.all([ dispatch(loadUserData(user)), - dispatch(loadFollowData(user.userId)), + dispatch(loadFriendsData(user.userId)), dispatch(loadUserMomentCategories(user.userId)), dispatch(loadUserMoments(user.userId)), dispatch(loadUserNotifications()), |
