Rename some components to make more sense.

master
Tom Hacohen 7 years ago
parent 134539a02b
commit e1bd0891fe

@ -8,9 +8,9 @@ import * as ICAL from 'ical.js';
import * as EteSync from './api/EteSync'; import * as EteSync from './api/EteSync';
import { routeResolver } from './App'; import { routeResolver } from './App';
import JournalViewContact from './JournalViewContact'; import Contact from './Contact';
class JournalViewAddressBook extends React.Component { class AddressBook extends React.Component {
static defaultProps = { static defaultProps = {
prevUid: null, prevUid: null,
}; };
@ -85,7 +85,7 @@ class JournalViewAddressBook extends React.Component {
render={({match}) => { render={({match}) => {
return ( return (
<JournalViewContact contact={items.get(match.params.itemUid)} /> <Contact contact={items.get(match.params.itemUid)} />
); );
}} }}
/> />
@ -95,4 +95,4 @@ class JournalViewAddressBook extends React.Component {
} }
} }
export default JournalViewAddressBook; export default AddressBook;

@ -33,7 +33,7 @@ class EventWrapper {
} }
} }
class JournalViewCalendar extends React.Component { class Calendar extends React.Component {
static defaultProps = { static defaultProps = {
prevUid: null, prevUid: null,
}; };
@ -101,4 +101,4 @@ class JournalViewCalendar extends React.Component {
} }
} }
export default JournalViewCalendar; export default Calendar;

@ -9,7 +9,7 @@ import { indigo500 } from 'material-ui/styles/colors';
import * as ICAL from 'ical.js'; import * as ICAL from 'ical.js';
class JournalViewContact extends React.Component { class ViewContact extends React.Component {
props: { props: {
contact?: ICAL.Component, contact?: ICAL.Component,
}; };
@ -97,4 +97,4 @@ class JournalViewContact extends React.Component {
} }
} }
export default JournalViewContact; export default ViewContact;

@ -5,9 +5,9 @@ import { Tabs, Tab } from 'material-ui/Tabs';
import * as EteSync from './api/EteSync'; import * as EteSync from './api/EteSync';
import JournalViewEntries from './JournalViewEntries'; import JournalEntries from './JournalEntries';
import JournalViewAddressBook from './JournalViewAddressBook'; import AddressBook from './AddressBook';
import JournalViewCalendar from './JournalViewCalendar'; import Calendar from './Calendar';
import LoadingIndicator from './LoadingIndicator'; import LoadingIndicator from './LoadingIndicator';
import { store, StoreState, JournalsData, EntriesType, CredentialsData, fetchEntries } from './store'; import { store, StoreState, JournalsData, EntriesType, CredentialsData, fetchEntries } from './store';
@ -22,7 +22,7 @@ interface PropsTypeInner extends PropsType {
entries: EntriesType; entries: EntriesType;
} }
class JournalView extends React.Component { class Journal extends React.Component {
static defaultProps = { static defaultProps = {
prevUid: null, prevUid: null,
}; };
@ -68,10 +68,10 @@ class JournalView extends React.Component {
let itemsTitle: string; let itemsTitle: string;
let itemsView: JSX.Element; let itemsView: JSX.Element;
if (collectionInfo.type === 'CALENDAR') { if (collectionInfo.type === 'CALENDAR') {
itemsView = <JournalViewCalendar journal={journal} entries={syncEntries} />; itemsView = <Calendar journal={journal} entries={syncEntries} />;
itemsTitle = 'Events'; itemsTitle = 'Events';
} else if (collectionInfo.type === 'ADDRESS_BOOK') { } else if (collectionInfo.type === 'ADDRESS_BOOK') {
itemsView = <JournalViewAddressBook journal={journal} entries={syncEntries} />; itemsView = <AddressBook journal={journal} entries={syncEntries} />;
itemsTitle = 'Contacts'; itemsTitle = 'Contacts';
} else { } else {
itemsView = <div>Unsupported type</div>; itemsView = <div>Unsupported type</div>;
@ -90,7 +90,7 @@ class JournalView extends React.Component {
label="Journal Entries" label="Journal Entries"
> >
<h2>{collectionInfo.displayName}</h2> <h2>{collectionInfo.displayName}</h2>
<JournalViewEntries journal={journal} entries={syncEntries} />; <JournalEntries journal={journal} entries={syncEntries} />;
</Tab> </Tab>
</Tabs> </Tabs>
); );
@ -105,4 +105,4 @@ const mapStateToProps = (state: StoreState, props: PropsType) => {
export default withRouter(connect( export default withRouter(connect(
mapStateToProps mapStateToProps
)(JournalView)); )(Journal));

@ -10,7 +10,7 @@ import * as ICAL from 'ical.js';
import * as EteSync from './api/EteSync'; import * as EteSync from './api/EteSync';
class JournalViewEntries extends React.Component { class JournalEntries extends React.Component {
static defaultProps = { static defaultProps = {
prevUid: null, prevUid: null,
}; };
@ -107,4 +107,4 @@ class JournalViewEntries extends React.Component {
} }
} }
export default JournalViewEntries; export default JournalEntries;

@ -4,7 +4,7 @@ import { Switch, Route, Redirect, withRouter } from 'react-router';
import LoadingIndicator from './LoadingIndicator'; import LoadingIndicator from './LoadingIndicator';
import JournalList from './JournalList'; import JournalList from './JournalList';
import JournalView from './JournalView'; import Journal from './Journal';
import { routeResolver } from './App'; import { routeResolver } from './App';
@ -50,7 +50,7 @@ class JournalFetcher extends React.Component {
/> />
<Route <Route
path={routeResolver.getRoute('journals._id')} path={routeResolver.getRoute('journals._id')}
render={({match}) => <JournalView match={match} etesync={this.props.etesync} journals={journals} />} render={({match}) => <Journal match={match} etesync={this.props.etesync} journals={journals} />}
/> />
</Switch> </Switch>
); );

Loading…
Cancel
Save