From b1070ecc94e6868e1d440383ec5f3605e79781be Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 12 Feb 2019 15:29:47 +0000 Subject: [PATCH] Restructure the journals route. This puts the jorunal list and the journal view in the same place and will make it easier to add new/edit. --- .../index.tsx => Journals/Journal.tsx} | 0 .../JournalsList.tsx} | 12 ++-- src/Journals/index.tsx | 60 +++++++++++++++++++ src/{Journal => Journals}/journalView.tsx | 0 src/SyncGate.tsx | 26 +++----- 5 files changed, 73 insertions(+), 25 deletions(-) rename src/{Journal/index.tsx => Journals/Journal.tsx} (100%) rename src/{Journals.tsx => Journals/JournalsList.tsx} (88%) create mode 100644 src/Journals/index.tsx rename src/{Journal => Journals}/journalView.tsx (100%) diff --git a/src/Journal/index.tsx b/src/Journals/Journal.tsx similarity index 100% rename from src/Journal/index.tsx rename to src/Journals/Journal.tsx diff --git a/src/Journals.tsx b/src/Journals/JournalsList.tsx similarity index 88% rename from src/Journals.tsx rename to src/Journals/JournalsList.tsx index 5e4b66b..6a58887 100644 --- a/src/Journals.tsx +++ b/src/Journals/JournalsList.tsx @@ -1,15 +1,15 @@ import * as React from 'react'; import { History } from 'history'; -import { List, ListItem } from './widgets/List'; +import { List, ListItem } from '../widgets/List'; -import * as EteSync from './api/EteSync'; +import * as EteSync from '../api/EteSync'; -import { routeResolver } from './App'; +import { routeResolver } from '../App'; -import { JournalsData, UserInfoData, CredentialsData } from './store'; +import { JournalsData, UserInfoData, CredentialsData } from '../store'; -class Journals extends React.PureComponent { +class JournalsList extends React.PureComponent { props: { etesync: CredentialsData; journals: JournalsData; @@ -79,4 +79,4 @@ class Journals extends React.PureComponent { } } -export default Journals; +export default JournalsList; diff --git a/src/Journals/index.tsx b/src/Journals/index.tsx new file mode 100644 index 0000000..e441837 --- /dev/null +++ b/src/Journals/index.tsx @@ -0,0 +1,60 @@ +import * as React from 'react'; +import { Location, History } from 'history'; +import { Route, Switch } from 'react-router'; + +import Journal from './Journal'; +import JournalsList from './JournalsList'; + +import AppBarOverride from '../widgets/AppBarOverride'; +import { routeResolver } from '../App'; + +import { JournalsData, UserInfoData, CredentialsData } from '../store'; +import { SyncInfo } from '../SyncGate'; + +class Journals extends React.PureComponent { + props: { + etesync: CredentialsData; + journals: JournalsData; + userInfo: UserInfoData; + syncInfo: SyncInfo; + history: History; + location: Location; + }; + + constructor(props: any) { + super(props); + } + + render() { + return ( + + ( + <> + + + + )} + /> + ( + + )} + /> + + ); + } +} + +export default Journals; diff --git a/src/Journal/journalView.tsx b/src/Journals/journalView.tsx similarity index 100% rename from src/Journal/journalView.tsx rename to src/Journals/journalView.tsx diff --git a/src/SyncGate.tsx b/src/SyncGate.tsx index 3c3e2e2..a4b8ae9 100644 --- a/src/SyncGate.tsx +++ b/src/SyncGate.tsx @@ -13,7 +13,6 @@ import LoadingIndicator from './widgets/LoadingIndicator'; import PrettyError from './widgets/PrettyError'; import Journals from './Journals'; -import Journal from './Journal'; import Pim from './Pim'; import * as EteSync from './api/EteSync'; @@ -208,25 +207,14 @@ class SyncGate extends React.PureComponent { /> ( - <> - - - - )} - /> - ( - ( + )} />