Improve journal page.

master
Tom Hacohen 7 years ago
parent af921e1b28
commit 25bf249d9f

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

@ -1,8 +1,11 @@
import * as React from 'react';
import { Route, Redirect } from 'react-router';
import { EteSyncContextType } from './EteSyncContext';
import * as EteSync from './api/EteSync';
import { routeResolver } from './App';
export class JournalView extends React.Component {
static defaultProps = {
prevUid: null,
@ -49,9 +52,20 @@ export class JournalView extends React.Component {
return (
<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>
{journals}
</ul>
}
/>
</div>
);
}

Loading…
Cancel
Save