ContactScreen.js use either firstname or lastname or both on Name column

This commit is contained in:
Jérémy Munsch 2023-09-05 11:53:31 +02:00
parent 66784532b4
commit 0ef471e175
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -266,7 +266,9 @@ class ContactScreen extends React.Component {
*/
Item(contact) {
const displayName =
String(contact.lastname ?? '').toUpperCase() + ' ' + contact.firstname;
String(contact.lastname ?? '').toUpperCase() +
' ' +
(contact.firstname ?? '');
return (
<View style={styles.item}>
<TouchableOpacity
@ -277,7 +279,7 @@ class ContactScreen extends React.Component {
})
}>
<Text style={{ ...styles.clickable, color: this.props.mainColor }}>
{contact.lastname && contact.firstname ? displayName : contact.id}
{contact.lastname || contact.firstname ? displayName : contact.id}
</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.composeNewEmailTo(contact.email)}>