diff --git a/src/JournalFetcher.tsx b/src/JournalFetcher.tsx index 4af3fe8..93abdbe 100644 --- a/src/JournalFetcher.tsx +++ b/src/JournalFetcher.tsx @@ -1,9 +1,8 @@ import * as React from 'react'; import { connect } from 'react-redux'; -import { Switch, Route, Redirect, withRouter } from 'react-router'; +import { Switch, Route, withRouter } from 'react-router'; import LoadingIndicator from './LoadingIndicator'; -import JournalList from './JournalList'; import Journal from './Journal'; import { routeResolver } from './App'; @@ -38,16 +37,6 @@ class JournalFetcher extends React.Component { return ( - } - /> - } - /> } diff --git a/src/JournalList.tsx b/src/JournalList.tsx deleted file mode 100644 index 6377f71..0000000 --- a/src/JournalList.tsx +++ /dev/null @@ -1,92 +0,0 @@ -import * as React from 'react'; -const Fragment = (React as any).Fragment; -import { Link } from 'react-router-dom'; - -import { List, ListItem } from 'material-ui/List'; -import Paper from 'material-ui/Paper'; - -import * as EteSync from './api/EteSync'; - -import { routeResolver } from './App'; -import { JournalsData, CredentialsData } from './store'; - -class JournalList extends React.Component { - props: { - etesync: CredentialsData; - journals: JournalsData; - }; - - constructor(props: any) { - super(props); - } - - render() { - const derived = this.props.etesync.encryptionKey; - const journalMap = this.props.journals.reduce( - (ret, journal) => { - if (journal.key) { - const key = 'UNSUPPORTED'; - ret[key] = ret[key] || []; - ret[key].push( - - {journal.uid.slice(0, 20)} - - ); - } else { - let cryptoManager = new EteSync.CryptoManager(derived, journal.uid, journal.version); - let info = journal.getInfo(cryptoManager); - ret[info.type] = ret[info.type] || []; - ret[info.type].push( - - - {info.displayName} ({journal.uid.slice(0, 5)}) - - - ); - } - - return ret; - }, - { CALENDAR: [], - ADDRESS_BOOK: [], - UNSUPPORTED: [] as Array}); - - const styles = { - paper: { - margin: 'auto', - maxWidth: 500, - padding: 20, - }, - }; - - return ( - -

Address Books

- - {journalMap.ADDRESS_BOOK} - - -

Calendars

- - {journalMap.CALENDAR} - - - { journalMap.UNSUPPORTED && ( - -

Unsupported

- - {journalMap.UNSUPPORTED} - -
- )} -
- ); - } -} - -export default JournalList;