From 93ac17c7d48d7597232df0ddf291acbf00961bd8 Mon Sep 17 00:00:00 2001 From: zdmc23 <191707+zdmc23@users.noreply.github.com> Date: Mon, 3 May 2021 22:16:18 -0400 Subject: [PATCH] Remove dupes from Connection lists; match Groups listItem height to Contacts --- screens/Contact/ContactDetailScreen.js | 5 +++-- screens/Group/GroupDetailScreen.js | 6 ++++-- screens/Group/GroupsScreen.styles.js | 2 +- shared/index.js | 1 - 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/screens/Contact/ContactDetailScreen.js b/screens/Contact/ContactDetailScreen.js index fad522b4..24f83253 100644 --- a/screens/Contact/ContactDetailScreen.js +++ b/screens/Contact/ContactDetailScreen.js @@ -1668,7 +1668,9 @@ class ContactDetailScreen extends React.Component { } }); } - return items; + // remove dupes + const set = new Set(items.map((item) => JSON.stringify(item))); + return [...set].map((item) => JSON.parse(item)); }; onViewOnMobileWeb = () => { @@ -3777,7 +3779,6 @@ class ContactDetailScreen extends React.Component { } else { switch (postType) { case 'contacts': { - //listItems = [...this.state.usersContacts]; listItems = [ ...this.state.subAssignedContacts, ...this.state.relationContacts, diff --git a/screens/Group/GroupDetailScreen.js b/screens/Group/GroupDetailScreen.js index 49085f3b..8def8299 100644 --- a/screens/Group/GroupDetailScreen.js +++ b/screens/Group/GroupDetailScreen.js @@ -1315,7 +1315,9 @@ class GroupDetailScreen extends React.Component { } }); } - return items; + // remove dupes + const set = new Set(items.map((item) => JSON.stringify(item))); + return [...set].map((item) => JSON.parse(item)); }; renderActivityOrCommentRow = (commentOrActivity) => ( @@ -3568,7 +3570,7 @@ class GroupDetailScreen extends React.Component { break; } case 'groups': { - collection = [...this.state.groups]; + collection = [...this.state.connectionGroups, ...this.state.groups]; isGroup = true; break; } diff --git a/screens/Group/GroupsScreen.styles.js b/screens/Group/GroupsScreen.styles.js index 12195a00..4b1224c0 100644 --- a/screens/Group/GroupsScreen.styles.js +++ b/screens/Group/GroupsScreen.styles.js @@ -2,7 +2,7 @@ import { StyleSheet } from 'react-native'; export const styles = StyleSheet.create({ flatListItem: { - height: 40 /* this needs auto sizing */, + height: 55, margin: 20, marginTop: 10, paddingBottom: 10, diff --git a/shared/index.js b/shared/index.js index d5204394..a3919e06 100644 --- a/shared/index.js +++ b/shared/index.js @@ -177,7 +177,6 @@ const formatDateToDatePicker = (timestamp = null) => { }; const getSelectorColor = (status) => { - console.log(`status: ${status}`); let newColor; if (status === 'new' || status === 'unassigned' || status === 'inactive') { newColor = '#d9534f';