diff options
Diffstat (limited to 'src/components/profile/ProfileBody.tsx')
-rw-r--r-- | src/components/profile/ProfileBody.tsx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx index 646be3e0..b49e71a3 100644 --- a/src/components/profile/ProfileBody.tsx +++ b/src/components/profile/ProfileBody.tsx @@ -2,21 +2,17 @@ import React from 'react'; import {LayoutChangeEvent, Linking, StyleSheet, Text, View} from 'react-native'; import {normalize} from 'react-native-elements'; import {useDispatch, useSelector, useStore} from 'react-redux'; -import { - TAGG_DARK_BLUE, - TAGG_LIGHT_BLUE, - TOGGLE_BUTTON_TYPE, -} from '../../constants'; +import {TAGG_DARK_BLUE, TOGGLE_BUTTON_TYPE} from '../../constants'; import { acceptFriendRequest, declineFriendRequest, updateUserXFriends, updateUserXProfileAllScreens, } from '../../store/actions'; -import {NO_PROFILE, NO_USER} from '../../store/initialStates'; +import {NO_PROFILE} from '../../store/initialStates'; import {RootState} from '../../store/rootReducer'; import {ScreenType} from '../../types'; -import {getUserAsProfilePreviewType, SCREEN_WIDTH} from '../../utils'; +import {getUserAsProfilePreviewType} from '../../utils'; import {FriendsButton} from '../common'; import ToggleButton from './ToggleButton'; @@ -34,12 +30,8 @@ const ProfileBody: React.FC<ProfileBodyProps> = ({ userXId, screenType, }) => { - const {profile = NO_PROFILE, user} = userXId - ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.user); - - const {user: loggedInUser = NO_USER} = useSelector( - (state: RootState) => state.user, + const {profile = NO_PROFILE, user} = useSelector((state: RootState) => + userXId ? state.userX[screenType][userXId] : state.user, ); const { @@ -119,6 +111,7 @@ const styles = StyleSheet.create({ flex: 1, paddingTop: '3.5%', paddingBottom: '2%', + width: '50%', }, container: { paddingVertical: '1%', |