diff --git a/src/JournalViewContact.tsx b/src/JournalViewContact.tsx index e2b3af9..a8b38ee 100644 --- a/src/JournalViewContact.tsx +++ b/src/JournalViewContact.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +const Fragment = (React as any).Fragment; import { List, ListItem } from 'material-ui/List'; import Divider from 'material-ui/Divider'; import CommunicationCall from 'material-ui/svg-icons/communication/call'; @@ -66,17 +67,28 @@ class JournalViewContact extends React.Component { }); return values; }); + + function listIfNotEmpty(items: Array>) { + if (items.length > 0) { + return ( + + + {items} + + + + ); + } else { + return undefined; + } + } + return (
-

{name} {uid}

- - {phoneNumbers} - - - - {emails} - - +

{name}

+ {uid} + {listIfNotEmpty(phoneNumbers)} + {listIfNotEmpty(emails)} {theRest}