diff options
author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-12-14 16:02:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-14 19:02:09 -0500 |
commit | 3b7bf256d83e1898642c2aab9072ffbeec8cc032 (patch) | |
tree | 9b48ff57f61414321e2c78124bd6a63101a04602 /src/components/profile/ProfilePreview.tsx | |
parent | 410d9224f4e198ab0b8ecae35fa05c240a2439bf (diff) |
[TMA - 426] Fix recent search + Add refresh control (#138)
* Got rid of small lint errors before start
* Final push
* Final
* disable scroll first try / logic
* small change
* Try to make the cover photo consistent with different screen sizes
* Final change
* added RefreshControl
* removed scale effect
* Fix misorientation of cover
* remove more scale stuff
* fix userIDs for different views
* Mend refresh control
* white bg
Co-authored-by: hsalhab <husam_salhab@brown.edu>
Diffstat (limited to 'src/components/profile/ProfilePreview.tsx')
-rw-r--r-- | src/components/profile/ProfilePreview.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/components/profile/ProfilePreview.tsx b/src/components/profile/ProfilePreview.tsx index 93d1f415..9dd03c54 100644 --- a/src/components/profile/ProfilePreview.tsx +++ b/src/components/profile/ProfilePreview.tsx @@ -17,8 +17,8 @@ import {UserType, PreviewType} from '../../types'; import {isUserBlocked} from '../../services'; import {useSelector, useDispatch, useStore} from 'react-redux'; import {RootState} from '../../store/rootreducer'; -import {loadUserX, logout} from '../../store/actions'; -import {userXInStore} from '../../utils'; +import {logout} from '../../store/actions'; +import {fetchUserX, userXInStore} from '../../utils'; const NO_USER: UserType = { userId: '', username: '', @@ -157,8 +157,10 @@ const ProfilePreview: React.FC<ProfilePreviewProps> = ({ * Finally, Navigate to profile of the user selected */ if (!userXInStore(state, screenType, user.id)) { - dispatch( - loadUserX({userId: user.id, username: user.username}, screenType), + await fetchUserX( + dispatch, + {userId: user.id, username: user.username}, + screenType, ); } navigation.push('Profile', { @@ -244,7 +246,6 @@ const ProfilePreview: React.FC<ProfilePreviewProps> = ({ )} {previewType === 'Discover Users' && ( <> - <Text style={nameStyle}>{first_name.concat(' ', last_name)}</Text> <Text style={usernameStyle}>{usernameToDisplay}</Text> </> )} |