From 0c9dfd7087b8b1bca767f86f735a8ee755eef62c Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 12 Dec 2017 19:11:48 +0000 Subject: [PATCH] Add a way to edit events. --- src/App.tsx | 10 ++++++++-- src/Pim.tsx | 29 ++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index a94bead..fb2527d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -42,11 +42,17 @@ export const routeResolver = new RouteResolver({ home: '', pim: { contacts: { - _id: ':contactUid', + _id: { + _base: ':contactUid', + edit: 'edit', + }, new: 'new', }, events: { - _id: ':eventUid', + _id: { + _base: ':eventUid', + edit: 'edit', + }, new: 'new', }, }, diff --git a/src/Pim.tsx b/src/Pim.tsx index 314c718..b09fe07 100644 --- a/src/Pim.tsx +++ b/src/Pim.tsx @@ -1,5 +1,7 @@ import * as React from 'react'; import { Route, Switch } from 'react-router'; +import RaisedButton from 'material-ui/RaisedButton'; +import IconEdit from 'material-ui/svg-icons/editor/mode-edit'; import * as EteSync from './api/EteSync'; @@ -127,10 +129,35 @@ class Pim extends React.Component { )} /> ( + + + + )} + /> + ( +
+ } + onClick={() => + history.push(routeResolver.getRoute( + 'pim.events._id.edit', + {eventUid: match.params.eventUid})) + } + /> +
)}