Improve journal page.

master
Tom Hacohen 7 years ago
parent af921e1b28
commit 25bf249d9f

@ -11,6 +11,12 @@ export const routeResolver = new RouteResolver({
_base: 'journals', _base: 'journals',
_id: { _id: {
_base: ':journalUid', _base: ':journalUid',
entries: {
_base: 'entries',
_id: {
_base: ':entryUid',
},
},
}, },
}, },
}); });

@ -1,8 +1,11 @@
import * as React from 'react'; import * as React from 'react';
import { Route, Redirect } from 'react-router';
import { EteSyncContextType } from './EteSyncContext'; import { EteSyncContextType } from './EteSyncContext';
import * as EteSync from './api/EteSync'; import * as EteSync from './api/EteSync';
import { routeResolver } from './App';
export class JournalView extends React.Component { export class JournalView extends React.Component {
static defaultProps = { static defaultProps = {
prevUid: null, prevUid: null,
@ -49,9 +52,20 @@ export class JournalView extends React.Component {
return ( return (
<div> <div>
<Route
path={routeResolver.getRoute('journals._id')}
exact={true}
render={() => <Redirect to={routeResolver.getRoute('journals._id.entries', {journalUid: journal})} />}
/>
<h2>Welcome to Journal!</h2>
<Route
path={routeResolver.getRoute('journals._id.entries')}
render={() =>
<ul> <ul>
{journals} {journals}
</ul> </ul>
}
/>
</div> </div>
); );
} }

Loading…
Cancel
Save