From ce5bf93fef3f5108e0dca35bf24accb4d9d654bb Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 23 Apr 2021 14:39:46 -0700 Subject: selective visibility, disabled gifs --- src/components/messages/ChatInput.tsx | 6 +++--- src/components/profile/ProfileHeader.tsx | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'src') 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')} /> */} - setText('/')}> + {/* setText('/')}> - + */} @@ -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 = ({ }) => { 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 = ({ userXName={userXName} setIsOpen={setDrawerVisible} /> - {measure && ( + {userId === loggedInUserId && measure && ( = ({ - setBadgeViewVisible(true)}> + { + if (userId === loggedInUserId) { + setBadgeViewVisible(true); + } + }}> - {showBadgeTutorial === true ? ( + {userId === loggedInUserId && showBadgeTutorial === true ? ( ) : (