aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-06 12:13:32 -0400
committerGitHub <noreply@github.com>2021-04-06 12:13:32 -0400
commitaac68b10d5f05f4a8bd137cfd2a85ef6f6e4dbdf (patch)
tree27c25da35cbae44fd264c88321bc2ede45ae34c9 /src/components
parentfbcb7a01fa643a14ff73e2537f13d61b67e23ace (diff)
parentf3a9e82020549b04834de6ac5a0ce1096f01e3f2 (diff)
Merge pull request #347 from ankit-thanekar007/tma-754-add-onPress
[HOTFIX] : Changes for empty contacts and text getting cut
Diffstat (limited to 'src/components')
-rw-r--r--src/components/common/TaggPrompt.tsx2
-rw-r--r--src/components/profile/Friends.tsx8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/components/common/TaggPrompt.tsx b/src/components/common/TaggPrompt.tsx
index 721b1eb8..5e125d00 100644
--- a/src/components/common/TaggPrompt.tsx
+++ b/src/components/common/TaggPrompt.tsx
@@ -68,7 +68,7 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
- height: isIPhoneX() ? SCREEN_HEIGHT / 6 : SCREEN_HEIGHT / 5,
+ height: SCREEN_HEIGHT / 4,
},
closeButton: {
position: 'relative',
diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx
index 44f6bb48..c1dca755 100644
--- a/src/components/profile/Friends.tsx
+++ b/src/components/profile/Friends.tsx
@@ -27,7 +27,7 @@ interface FriendsProps {
const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
const state: RootState = useStore().getState();
const dispatch = useDispatch();
- const {user: loggedInUser = NO_USER} = state;
+ const {user: loggedInUser = NO_USER} = state.user;
const navigation = useNavigation();
const [usersFromContacts, setUsersFromContacts] = useState<
ProfilePreviewType[]
@@ -39,7 +39,7 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
const permission = await checkPermission();
if (permission === 'authorized') {
let response = await usersFromContactsService(contacts);
- await setUsersFromContacts(response.existing_tagg_users);
+ setUsersFromContacts(response.existing_tagg_users);
} else {
console.log('Authorize access to contacts');
}
@@ -84,10 +84,10 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
return (
<>
- {loggedInUser.userId === userId && (
+ {loggedInUser.userId === userId && usersFromContacts.length !== 0 && (
<View style={styles.subheader}>
<View style={styles.addFriendHeaderContainer}>
- <Text style={[styles.subheaderText]}>Contacts on tagg</Text>
+ <Text style={[styles.subheaderText]}>Contacts on Tagg</Text>
</View>
<UsersFromContacts />
</View>