|
|
@ -1,6 +1,4 @@
|
|
|
|
import * as React from 'react';
|
|
|
|
import * as React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
|
|
import { withRouter } from 'react-router';
|
|
|
|
|
|
|
|
import { Tabs, Tab } from 'material-ui/Tabs';
|
|
|
|
import { Tabs, Tab } from 'material-ui/Tabs';
|
|
|
|
|
|
|
|
|
|
|
|
import * as EteSync from './api/EteSync';
|
|
|
|
import * as EteSync from './api/EteSync';
|
|
|
@ -12,16 +10,16 @@ import LoadingIndicator from './LoadingIndicator';
|
|
|
|
|
|
|
|
|
|
|
|
import { syncEntriesToItemMap, syncEntriesToCalendarItemMap } from './journal-processors';
|
|
|
|
import { syncEntriesToItemMap, syncEntriesToCalendarItemMap } from './journal-processors';
|
|
|
|
|
|
|
|
|
|
|
|
import { store, StoreState, JournalsData, EntriesType, CredentialsData, fetchEntries } from './store';
|
|
|
|
import { JournalsData, EntriesType, CredentialsData } from './store';
|
|
|
|
|
|
|
|
|
|
|
|
interface PropsType {
|
|
|
|
interface PropsType {
|
|
|
|
journals: JournalsData;
|
|
|
|
journals: JournalsData;
|
|
|
|
|
|
|
|
entries: EntriesType;
|
|
|
|
etesync: CredentialsData;
|
|
|
|
etesync: CredentialsData;
|
|
|
|
match: any;
|
|
|
|
match: any;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface PropsTypeInner extends PropsType {
|
|
|
|
interface PropsTypeInner extends PropsType {
|
|
|
|
entries: EntriesType;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class Journal extends React.Component {
|
|
|
|
class Journal extends React.Component {
|
|
|
@ -35,12 +33,6 @@ class Journal extends React.Component {
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
const journal = this.props.match.params.journalUid;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
store.dispatch(fetchEntries(this.props.etesync, journal, null));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const journalUid = this.props.match.params.journalUid;
|
|
|
|
const journalUid = this.props.match.params.journalUid;
|
|
|
|
const entries = this.props.entries[journalUid];
|
|
|
|
const entries = this.props.entries[journalUid];
|
|
|
@ -99,12 +91,4 @@ class Journal extends React.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state: StoreState, props: PropsType) => {
|
|
|
|
export default Journal;
|
|
|
|
return {
|
|
|
|
|
|
|
|
entries: state.cache.entries,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default withRouter(connect(
|
|
|
|
|
|
|
|
mapStateToProps
|
|
|
|
|
|
|
|
)(Journal));
|
|
|
|
|
|
|
|