aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/messages/ChatInput.tsx6
-rw-r--r--src/components/profile/ProfileHeader.tsx19
2 files changed, 17 insertions, 8 deletions
diff --git a/src/components/messages/ChatInput.tsx b/src/components/messages/ChatInput.tsx
index bde5fc12..2ae220c6 100644
--- a/src/components/messages/ChatInput.tsx
+++ b/src/components/messages/ChatInput.tsx
@@ -84,12 +84,12 @@ const ChatInput: React.FC<
source={require('../../assets/images/camera.png')}
/>
</TouchableOpacity> */}
- <TouchableOpacity onPress={() => setText('/')}>
+ {/* <TouchableOpacity onPress={() => setText('/')}>
<Image
style={{width: normalize(23), height: normalize(23)}}
source={require('../../assets/images/gif.png')}
/>
- </TouchableOpacity>
+ </TouchableOpacity> */}
<ChatInputSubmit onPress={sendMessage} outlined={text.length === 0} />
</View>
</View>
@@ -132,7 +132,7 @@ const styles = StyleSheet.create({
actionButtons: {
height: normalize(30) + 10,
flexDirection: 'row',
- justifyContent: 'space-evenly',
+ justifyContent: 'flex-end',
alignItems: 'center',
marginRight: 10,
width: 100,
diff --git a/src/components/profile/ProfileHeader.tsx b/src/components/profile/ProfileHeader.tsx
index 89d41d57..90206f8d 100644
--- a/src/components/profile/ProfileHeader.tsx
+++ b/src/components/profile/ProfileHeader.tsx
@@ -1,7 +1,7 @@
import React, {useLayoutEffect, useRef, useState} from 'react';
import {StyleSheet, Text, View} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
-import {useSelector} from 'react-redux';
+import {useSelector, useStore} from 'react-redux';
import {PROFILE_CUTOUT_TOP_Y} from '../../constants';
import {RootState} from '../../store/rootreducer';
import {ScreenType} from '../../types';
@@ -28,11 +28,14 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
}) => {
const {
profile: {name = '', university_class = 2021, university},
- user: {username: userXName = ''},
+ user: {username: userXName = '', userId},
} = useSelector((state: RootState) =>
userXId ? state.userX[screenType][userXId] : state.user,
);
+ const state: RootState = useStore().getState();
+ const loggedInUserId = state.user.user.userId;
+
const {
user: {username = ''},
} = useSelector((state: RootState) => state.user);
@@ -78,7 +81,7 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
userXName={userXName}
setIsOpen={setDrawerVisible}
/>
- {measure && (
+ {userId === loggedInUserId && measure && (
<BadgeTutorialScreen
uniIconProps={{
university: university,
@@ -107,9 +110,15 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
<View style={styles.friendsAndUniversity}>
<FriendsCount screenType={screenType} userXId={userXId} />
- <TouchableOpacity onPress={() => setBadgeViewVisible(true)}>
+ <TouchableOpacity
+ disabled={userId === loggedInUserId ? false : true}
+ onPress={() => {
+ if (userId === loggedInUserId) {
+ setBadgeViewVisible(true);
+ }
+ }}>
<View ref={childRef}>
- {showBadgeTutorial === true ? (
+ {userId === loggedInUserId && showBadgeTutorial === true ? (
<View style={styles.emptyContainer} />
) : (
<UniversityIcon