aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/ProfileBody.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-29 15:01:52 -0400
committerGitHub <noreply@github.com>2021-03-29 15:01:52 -0400
commitad2ad5d232473d38426c2f0f8283ba015dadfd4c (patch)
treef375a074fa23ca70c304f93b5577ed830250394c /src/components/profile/ProfileBody.tsx
parent4de1ebd43437712e28a89bb624c5b12afad45cc6 (diff)
parentee80ddfb8a486fea31d845aba4e0b4847fe637e9 (diff)
Merge pull request #306 from TaggiD-Inc/tma-701-private-account-banner
[TMA 701] : Separated Private and Public Profiles
Diffstat (limited to 'src/components/profile/ProfileBody.tsx')
-rw-r--r--src/components/profile/ProfileBody.tsx19
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%',