From c10a4cc924bcc4cd6c5cb6fe27e071c21c1bafe8 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 7 Dec 2017 20:53:33 +0000 Subject: [PATCH] Move the main page under pim and redirect there. --- src/App.tsx | 4 ++++ src/Main.tsx | 1 + src/SyncGate.tsx | 15 ++++++++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 7f30552..703cc18 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -40,6 +40,10 @@ export function getPalette(part: string): string { export const routeResolver = new RouteResolver({ home: '', + pim: { + contacts: 'contacts/:contactUid', + events: 'events/:contactUid', + }, journals: { _id: { _base: ':journalUid', diff --git a/src/Main.tsx b/src/Main.tsx index 67035e8..fa879e0 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -15,6 +15,7 @@ class Main extends React.Component { etesync: CredentialsData; journals: JournalsData; entries: EntriesType; + match: any; }; constructor(props: any) { diff --git a/src/SyncGate.tsx b/src/SyncGate.tsx index 7b399a6..f5cb5a1 100644 --- a/src/SyncGate.tsx +++ b/src/SyncGate.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { connect } from 'react-redux'; -import { Route, Switch, withRouter } from 'react-router'; +import { Route, Switch, Redirect, withRouter } from 'react-router'; import { routeResolver } from './App'; @@ -62,10 +62,15 @@ class SyncGate extends React.Component { ( -
- ) - } + render={({match}) => ( + + )} + /> + ( +
+ )} />