Don't change history when switching tabs.

master
Tom Hacohen 7 years ago
parent b0741978d0
commit df4ea83208

@ -1,13 +1,9 @@
import * as React from 'react'; import * as React from 'react';
import { Route, Redirect } from 'react-router';
import { Link } from 'react-router-dom';
import { Tabs, Tab } from 'material-ui/Tabs'; import { Tabs, Tab } from 'material-ui/Tabs';
import { EteSyncContextType } from './EteSyncContext'; import { EteSyncContextType } from './EteSyncContext';
import * as EteSync from './api/EteSync'; import * as EteSync from './api/EteSync';
import { routeResolver } from './App';
import { JournalViewEntries } from './JournalViewEntries'; import { JournalViewEntries } from './JournalViewEntries';
import { JournalViewAddressBook } from './JournalViewAddressBook'; import { JournalViewAddressBook } from './JournalViewAddressBook';
import { JournalViewCalendar } from './JournalViewCalendar'; import { JournalViewCalendar } from './JournalViewCalendar';
@ -86,24 +82,17 @@ export class JournalView extends React.Component {
<Tabs> <Tabs>
<Tab <Tab
label={itemsTitle} label={itemsTitle}
containerElement={<Link to={routeResolver.getRoute('journals._id.items', {journalUid: journal.uid})} />}
> >
<h2>{collectionInfo.displayName}</h2> <h2>{collectionInfo.displayName}</h2>
{itemsView} {itemsView}
</Tab> </Tab>
<Tab <Tab
label="Journal Entries" label="Journal Entries"
containerElement={<Link to={routeResolver.getRoute('journals._id.entries', {journalUid: journal.uid})} />}
> >
<h2>{collectionInfo.displayName}</h2> <h2>{collectionInfo.displayName}</h2>
<JournalViewEntries journal={journal} entries={syncEntries} />; <JournalViewEntries journal={journal} entries={syncEntries} />;
</Tab> </Tab>
</Tabs> </Tabs>
<Route
path={routeResolver.getRoute('journals._id')}
exact={true}
render={() => <Redirect to={routeResolver.getRoute('journals._id.items', {journalUid: journal.uid})} />}
/>
</div> </div>
); );
} }

@ -70,7 +70,7 @@ export class JournalViewAddressBook extends React.Component {
<div> <div>
<Switch> <Switch>
<Route <Route
path={routeResolver.getRoute('journals._id.items')} path={routeResolver.getRoute('journals._id')}
exact={true} exact={true}
render={() => ( render={() => (
<List> <List>

Loading…
Cancel
Save