|
|
@ -51,7 +51,8 @@ class Journal extends React.PureComponent<PropsTypeInner> {
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { theme } = this.props;
|
|
|
|
const { theme } = this.props;
|
|
|
|
const currentTab = this.state.tab;
|
|
|
|
let currentTab = this.state.tab;
|
|
|
|
|
|
|
|
let journalOnly = false;
|
|
|
|
const journalUid = this.props.match.params.journalUid;
|
|
|
|
const journalUid = this.props.match.params.journalUid;
|
|
|
|
|
|
|
|
|
|
|
|
const syncJournal = this.props.syncInfo.get(journalUid);
|
|
|
|
const syncJournal = this.props.syncInfo.get(journalUid);
|
|
|
@ -73,11 +74,18 @@ class Journal extends React.PureComponent<PropsTypeInner> {
|
|
|
|
itemsView =
|
|
|
|
itemsView =
|
|
|
|
<JournalAddressBook journal={journal} entries={syncEntriesToItemMap(collectionInfo, syncEntries)} />;
|
|
|
|
<JournalAddressBook journal={journal} entries={syncEntriesToItemMap(collectionInfo, syncEntries)} />;
|
|
|
|
itemsTitle = 'Contacts';
|
|
|
|
itemsTitle = 'Contacts';
|
|
|
|
|
|
|
|
} else if (collectionInfo.type === 'TASKS') {
|
|
|
|
|
|
|
|
itemsView = <div>Task preview is not yet supported</div>;
|
|
|
|
|
|
|
|
itemsTitle = 'Tasks';
|
|
|
|
|
|
|
|
journalOnly = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
itemsView = <div>Unsupported type</div>;
|
|
|
|
itemsView = <div>Preview is not supported for this journal type</div>;
|
|
|
|
itemsTitle = 'Items';
|
|
|
|
itemsTitle = 'Items';
|
|
|
|
|
|
|
|
journalOnly = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
currentTab = journalOnly ? 1 : currentTab;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<React.Fragment>
|
|
|
|
<React.Fragment>
|
|
|
|
<SecondaryHeader text={collectionInfo.displayName} />
|
|
|
|
<SecondaryHeader text={collectionInfo.displayName} />
|
|
|
@ -87,7 +95,7 @@ class Journal extends React.PureComponent<PropsTypeInner> {
|
|
|
|
value={currentTab}
|
|
|
|
value={currentTab}
|
|
|
|
onChange={(event, tab) => this.setState({ tab })}
|
|
|
|
onChange={(event, tab) => this.setState({ tab })}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Tab label={itemsTitle} />
|
|
|
|
<Tab label={itemsTitle} disabled={journalOnly} />
|
|
|
|
<Tab label="Journal Entries" />
|
|
|
|
<Tab label="Journal Entries" />
|
|
|
|
</Tabs>
|
|
|
|
</Tabs>
|
|
|
|
{ currentTab === 0 &&
|
|
|
|
{ currentTab === 0 &&
|
|
|
|