From b0741978d0288892d012c9d169469936995116e2 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 4 Dec 2017 22:14:02 +0000 Subject: [PATCH] Journal list: improve look. --- src/JournalViewEntries.tsx | 43 +++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/src/JournalViewEntries.tsx b/src/JournalViewEntries.tsx index 656d34f..e4bfe42 100644 --- a/src/JournalViewEntries.tsx +++ b/src/JournalViewEntries.tsx @@ -1,4 +1,8 @@ import * as React from 'react'; +import { List, ListItem } from 'material-ui/List'; +import IconAdd from 'material-ui/svg-icons/content/add'; +import IconDelete from 'material-ui/svg-icons/action/delete'; +import IconEdit from 'material-ui/svg-icons/editor/mode-edit'; import * as ICAL from 'ical.js'; @@ -22,24 +26,53 @@ export class JournalViewEntries extends React.Component { const entries = this.props.entries.map((syncEntry, idx) => { const comp = new ICAL.Component(ICAL.parse(syncEntry.content)); + let icon; + if (syncEntry.action === EteSync.SyncEntryAction.Add) { + icon = (); + } else if (syncEntry.action === EteSync.SyncEntryAction.Change) { + icon = (); + } else if (syncEntry.action === EteSync.SyncEntryAction.Delete) { + icon = (); + } + if (comp.name === 'vcalendar') { const vevent = new ICAL.Event(comp.getFirstSubcomponent('vevent')); - return (
  • {syncEntry.action}: {vevent.summary} ({vevent.uid})
  • ); + return ( + + ); } else if (comp.name === 'vcard') { const vcard = comp; const name = vcard.getFirstPropertyValue('fn'); const uid = vcard.getFirstPropertyValue('uid'); - return (
  • {syncEntry.action}: {name} ({uid})
  • ); + return ( + + ); } else { - return (
  • {syncEntry.action}: {syncEntry.content}
  • ); + return ( + + ); } }).reverse(); return (
    -
      + {entries} -
    +
    ); }