From e1bd0891fe9d38a16c75328398682877fe5fea1d Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 7 Dec 2017 00:50:35 +0000 Subject: [PATCH] Rename some components to make more sense. --- ...ournalViewAddressBook.tsx => AddressBook.tsx} | 8 ++++---- src/{JournalViewCalendar.tsx => Calendar.tsx} | 4 ++-- src/{JournalViewContact.tsx => Contact.tsx} | 4 ++-- src/{JournalView.tsx => Journal.tsx} | 16 ++++++++-------- ...JournalViewEntries.tsx => JournalEntries.tsx} | 4 ++-- src/JournalFetcher.tsx | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) rename src/{JournalViewAddressBook.tsx => AddressBook.tsx} (90%) rename src/{JournalViewCalendar.tsx => Calendar.tsx} (96%) rename src/{JournalViewContact.tsx => Contact.tsx} (96%) rename src/{JournalView.tsx => Journal.tsx} (83%) rename src/{JournalViewEntries.tsx => JournalEntries.tsx} (96%) diff --git a/src/JournalViewAddressBook.tsx b/src/AddressBook.tsx similarity index 90% rename from src/JournalViewAddressBook.tsx rename to src/AddressBook.tsx index 5a18712..a16ff1f 100644 --- a/src/JournalViewAddressBook.tsx +++ b/src/AddressBook.tsx @@ -8,9 +8,9 @@ import * as ICAL from 'ical.js'; import * as EteSync from './api/EteSync'; import { routeResolver } from './App'; -import JournalViewContact from './JournalViewContact'; +import Contact from './Contact'; -class JournalViewAddressBook extends React.Component { +class AddressBook extends React.Component { static defaultProps = { prevUid: null, }; @@ -85,7 +85,7 @@ class JournalViewAddressBook extends React.Component { render={({match}) => { return ( - + ); }} /> @@ -95,4 +95,4 @@ class JournalViewAddressBook extends React.Component { } } -export default JournalViewAddressBook; +export default AddressBook; diff --git a/src/JournalViewCalendar.tsx b/src/Calendar.tsx similarity index 96% rename from src/JournalViewCalendar.tsx rename to src/Calendar.tsx index 34e46ea..22711a2 100644 --- a/src/JournalViewCalendar.tsx +++ b/src/Calendar.tsx @@ -33,7 +33,7 @@ class EventWrapper { } } -class JournalViewCalendar extends React.Component { +class Calendar extends React.Component { static defaultProps = { prevUid: null, }; @@ -101,4 +101,4 @@ class JournalViewCalendar extends React.Component { } } -export default JournalViewCalendar; +export default Calendar; diff --git a/src/JournalViewContact.tsx b/src/Contact.tsx similarity index 96% rename from src/JournalViewContact.tsx rename to src/Contact.tsx index a8b38ee..6ada747 100644 --- a/src/JournalViewContact.tsx +++ b/src/Contact.tsx @@ -9,7 +9,7 @@ import { indigo500 } from 'material-ui/styles/colors'; import * as ICAL from 'ical.js'; -class JournalViewContact extends React.Component { +class ViewContact extends React.Component { props: { contact?: ICAL.Component, }; @@ -97,4 +97,4 @@ class JournalViewContact extends React.Component { } } -export default JournalViewContact; +export default ViewContact; diff --git a/src/JournalView.tsx b/src/Journal.tsx similarity index 83% rename from src/JournalView.tsx rename to src/Journal.tsx index 9e0b656..b35060d 100644 --- a/src/JournalView.tsx +++ b/src/Journal.tsx @@ -5,9 +5,9 @@ import { Tabs, Tab } from 'material-ui/Tabs'; import * as EteSync from './api/EteSync'; -import JournalViewEntries from './JournalViewEntries'; -import JournalViewAddressBook from './JournalViewAddressBook'; -import JournalViewCalendar from './JournalViewCalendar'; +import JournalEntries from './JournalEntries'; +import AddressBook from './AddressBook'; +import Calendar from './Calendar'; import LoadingIndicator from './LoadingIndicator'; import { store, StoreState, JournalsData, EntriesType, CredentialsData, fetchEntries } from './store'; @@ -22,7 +22,7 @@ interface PropsTypeInner extends PropsType { entries: EntriesType; } -class JournalView extends React.Component { +class Journal extends React.Component { static defaultProps = { prevUid: null, }; @@ -68,10 +68,10 @@ class JournalView extends React.Component { let itemsTitle: string; let itemsView: JSX.Element; if (collectionInfo.type === 'CALENDAR') { - itemsView = ; + itemsView = ; itemsTitle = 'Events'; } else if (collectionInfo.type === 'ADDRESS_BOOK') { - itemsView = ; + itemsView = ; itemsTitle = 'Contacts'; } else { itemsView =
Unsupported type
; @@ -90,7 +90,7 @@ class JournalView extends React.Component { label="Journal Entries" >

{collectionInfo.displayName}

- ; + ; ); @@ -105,4 +105,4 @@ const mapStateToProps = (state: StoreState, props: PropsType) => { export default withRouter(connect( mapStateToProps -)(JournalView)); +)(Journal)); diff --git a/src/JournalViewEntries.tsx b/src/JournalEntries.tsx similarity index 96% rename from src/JournalViewEntries.tsx rename to src/JournalEntries.tsx index dd9a645..e91219c 100644 --- a/src/JournalViewEntries.tsx +++ b/src/JournalEntries.tsx @@ -10,7 +10,7 @@ import * as ICAL from 'ical.js'; import * as EteSync from './api/EteSync'; -class JournalViewEntries extends React.Component { +class JournalEntries extends React.Component { static defaultProps = { prevUid: null, }; @@ -107,4 +107,4 @@ class JournalViewEntries extends React.Component { } } -export default JournalViewEntries; +export default JournalEntries; diff --git a/src/JournalFetcher.tsx b/src/JournalFetcher.tsx index 2afc9e3..4af3fe8 100644 --- a/src/JournalFetcher.tsx +++ b/src/JournalFetcher.tsx @@ -4,7 +4,7 @@ import { Switch, Route, Redirect, withRouter } from 'react-router'; import LoadingIndicator from './LoadingIndicator'; import JournalList from './JournalList'; -import JournalView from './JournalView'; +import Journal from './Journal'; import { routeResolver } from './App'; @@ -50,7 +50,7 @@ class JournalFetcher extends React.Component { /> } + render={({match}) => } /> );