diff --git a/src/Contact.tsx b/src/Contact.tsx index b726697..4cb1a87 100644 --- a/src/Contact.tsx +++ b/src/Contact.tsx @@ -6,6 +6,8 @@ import CommunicationChatBubble from 'material-ui/svg-icons/communication/chat-bu import CommunicationEmail from 'material-ui/svg-icons/communication/email'; import { indigo500 } from 'material-ui/styles/colors'; +import PimItemHeader from './PimItemHeader'; + import { ContactType } from './pim-types'; class Contact extends React.Component { @@ -106,7 +108,7 @@ class Contact extends React.Component { return (
-

{name}

+ {lists.map((list, idx) => ( {listIfNotEmpty(list)} diff --git a/src/Event.tsx b/src/Event.tsx index 60a4f24..8abc95e 100644 --- a/src/Event.tsx +++ b/src/Event.tsx @@ -1,6 +1,8 @@ import * as React from 'react'; import * as moment from 'moment'; +import PimItemHeader from './PimItemHeader'; + import * as ICAL from 'ical.js'; import { EventType } from './pim-types'; @@ -43,14 +45,25 @@ class Event extends React.Component { throw Error('Event should be defined!'); } + const style = { + content: { + padding: 15, + }, + }; + return ( -
-

{this.props.event.summary}

-
{formatDateRange(this.props.event.startDate, this.props.event.endDate)}
-
{this.props.event.location}
-
{this.props.event.description}
-
Attendees: {this.props.event.attendees.map((x) => (x.getFirstValue())).join(', ')}
-
+ + +
{formatDateRange(this.props.event.startDate, this.props.event.endDate)}
+
+
{this.props.event.location}
+
+
+
{this.props.event.description}
+ {(this.props.event.attendees.length > 0) && ( +
Attendees: {this.props.event.attendees.map((x) => (x.getFirstValue())).join(', ')}
)} +
+
); } } diff --git a/src/PimItemHeader.tsx b/src/PimItemHeader.tsx new file mode 100644 index 0000000..544883a --- /dev/null +++ b/src/PimItemHeader.tsx @@ -0,0 +1,24 @@ +import * as React from 'react'; + +import { getPalette } from './App'; + +export default (props: {text: string, children?: any}) => { + const style = { + header: { + backgroundColor: getPalette('accent1Color'), + color: getPalette('alternateTextColor'), + padding: 15, + }, + headerText: { + marginTop: 10, + marginBottom: 10, + }, + }; + + return ( +
+

{props.text}

+ {props.children} +
+ ); +};