Fix react-router related types.
parent
06887c58c3
commit
ec8a1d9017
|
@ -5,6 +5,8 @@ import * as EteSync from '../api/EteSync';
|
|||
|
||||
import { routeResolver } from '../App';
|
||||
|
||||
import { History } from 'history';
|
||||
|
||||
import AddressBook from '../components/AddressBook';
|
||||
import Contact from '../components/Contact';
|
||||
|
||||
|
@ -18,7 +20,7 @@ class JournalAddressBook extends React.PureComponent {
|
|||
props: {
|
||||
journal: EteSync.Journal,
|
||||
entries: {[key: string]: ContactType},
|
||||
history?: any,
|
||||
history?: History,
|
||||
};
|
||||
|
||||
constructor(props: any) {
|
||||
|
@ -29,7 +31,7 @@ class JournalAddressBook extends React.PureComponent {
|
|||
contactClicked(contact: ContactType) {
|
||||
const uid = contact.uid;
|
||||
|
||||
this.props.history.push(
|
||||
this.props.history!.push(
|
||||
routeResolver.getRoute('journals._id.items._id', { journalUid: this.props.journal.uid, itemUid: uid }));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import * as React from 'react';
|
||||
import { Route, Switch, withRouter } from 'react-router';
|
||||
|
||||
import { History } from 'history';
|
||||
|
||||
import { routeResolver } from '../App';
|
||||
|
||||
import { historyPersistor } from '../persist-state-history';
|
||||
|
@ -22,7 +24,7 @@ class JournalCalendar extends React.PureComponent {
|
|||
props: {
|
||||
journal: EteSync.Journal,
|
||||
entries: {[key: string]: EventType},
|
||||
history?: any,
|
||||
history?: History,
|
||||
};
|
||||
|
||||
constructor(props: any) {
|
||||
|
@ -33,7 +35,7 @@ class JournalCalendar extends React.PureComponent {
|
|||
eventClicked(event: EventType) {
|
||||
const uid = event.uid;
|
||||
|
||||
this.props.history.push(
|
||||
this.props.history!.push(
|
||||
routeResolver.getRoute('journals._id.items._id', { journalUid: this.props.journal.uid, itemUid: uid }));
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,11 @@ import { syncEntriesToItemMap, syncEntriesToCalendarItemMap } from '../journal-p
|
|||
|
||||
import { SyncInfo } from '../SyncGate';
|
||||
|
||||
import { match } from 'react-router';
|
||||
|
||||
interface PropsType {
|
||||
syncInfo: SyncInfo;
|
||||
match: any;
|
||||
match: match<any>;
|
||||
}
|
||||
|
||||
interface PropsTypeInner extends PropsType {
|
||||
|
|
|
@ -5,6 +5,8 @@ import { Tabs, Tab } from 'material-ui/Tabs';
|
|||
|
||||
import * as ICAL from 'ical.js';
|
||||
|
||||
import { Location, History } from 'history';
|
||||
|
||||
import Container from '../widgets/Container';
|
||||
|
||||
import AddressBook from '../components/AddressBook';
|
||||
|
@ -25,8 +27,8 @@ class PimMain extends React.PureComponent {
|
|||
props: {
|
||||
contacts: Array<ContactType>,
|
||||
events: Array<EventType>,
|
||||
location?: any,
|
||||
history?: any,
|
||||
location?: Location,
|
||||
history?: History,
|
||||
};
|
||||
|
||||
state: {
|
||||
|
@ -44,24 +46,24 @@ class PimMain extends React.PureComponent {
|
|||
eventClicked(event: ICAL.Event) {
|
||||
const uid = event.uid;
|
||||
|
||||
this.props.history.push(
|
||||
this.props.history!.push(
|
||||
routeResolver.getRoute('pim.events._id', { eventUid: uid }));
|
||||
}
|
||||
|
||||
contactClicked(contact: ContactType) {
|
||||
const uid = contact.uid;
|
||||
|
||||
this.props.history.push(
|
||||
this.props.history!.push(
|
||||
routeResolver.getRoute('pim.contacts._id', { contactUid: uid }));
|
||||
}
|
||||
|
||||
floatingButtonClicked() {
|
||||
if (this.state.tab === addressBookTitle) {
|
||||
this.props.history.push(
|
||||
this.props.history!.push(
|
||||
routeResolver.getRoute('pim.contacts.new')
|
||||
);
|
||||
} else if (this.state.tab === calendarTitle) {
|
||||
this.props.history.push(
|
||||
this.props.history!.push(
|
||||
routeResolver.getRoute('pim.events.new')
|
||||
);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import * as EteSync from '../api/EteSync';
|
|||
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
import { History } from 'history';
|
||||
|
||||
import { ContactType, EventType } from '../pim-types';
|
||||
|
||||
import Container from '../widgets/Container';
|
||||
|
@ -67,7 +69,7 @@ class Pim extends React.PureComponent {
|
|||
props: {
|
||||
etesync: CredentialsData;
|
||||
syncInfo: SyncInfo;
|
||||
history: any;
|
||||
history: History;
|
||||
};
|
||||
|
||||
constructor(props: any) {
|
||||
|
|
|
@ -10,6 +10,8 @@ import LogoutIcon from 'material-ui/svg-icons/action/power-settings-new';
|
|||
|
||||
const logo = require('../images/logo.svg');
|
||||
|
||||
import { History } from 'history';
|
||||
|
||||
import SideMenuJournals from './SideMenuJournals';
|
||||
|
||||
import { routeResolver, getPalette } from '../App';
|
||||
|
@ -26,7 +28,7 @@ interface PropsType {
|
|||
|
||||
interface PropsTypeInner extends PropsType {
|
||||
journals: JournalsType;
|
||||
history: any;
|
||||
history: History;
|
||||
}
|
||||
|
||||
class SideMenu extends React.PureComponent {
|
||||
|
|
Loading…
Reference in New Issue