diff options
author | Shravya Ramesh <shravs1208@gmail.com> | 2021-04-23 14:39:46 -0700 |
---|---|---|
committer | Shravya Ramesh <shravs1208@gmail.com> | 2021-04-23 14:39:46 -0700 |
commit | ce5bf93fef3f5108e0dca35bf24accb4d9d654bb (patch) | |
tree | 6795b52d0136abea9be23fb000bd513896af1e38 | |
parent | 70ff4dc0c8d8fa7b05087c6dbc08f2def895b922 (diff) |
selective visibility, disabled gifs
-rw-r--r-- | src/components/messages/ChatInput.tsx | 6 | ||||
-rw-r--r-- | src/components/profile/ProfileHeader.tsx | 19 |
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 |