Make all of the React.Components Pure.

master
Tom Hacohen 7 years ago
parent c3e686002e
commit a6ad199023

@ -6,7 +6,7 @@ import * as colors from 'material-ui/styles/colors';
import { ContactType } from './pim-types';
class AddressBook extends React.Component {
class AddressBook extends React.PureComponent {
props: {
entries: Array<ContactType>,
onItemClick: (contact: ContactType) => void,

@ -73,7 +73,7 @@ export const routeResolver = new RouteResolver({
},
});
class App extends React.Component {
class App extends React.PureComponent {
state: {
drawerOpen: boolean,
};

@ -9,7 +9,7 @@ import { EventType } from './pim-types';
moment.locale('en-gb');
BigCalendar.momentLocalizer(moment);
class Calendar extends React.Component {
class Calendar extends React.PureComponent {
state: {
currentDate?: Date;
};

@ -14,7 +14,7 @@ import PimItemHeader from './PimItemHeader';
import { ContactType } from './pim-types';
class Contact extends React.Component {
class Contact extends React.PureComponent {
props: {
contact?: ContactType,
};

@ -102,7 +102,7 @@ const ValueTypeComponent = (props: ValueTypeComponentProps) => {
);
};
class ContactEdit extends React.Component {
class ContactEdit extends React.PureComponent {
state: {
uid: string,
fn: string;

@ -1,6 +1,6 @@
import * as React from 'react';
class DateTimePicker extends React.Component {
class DateTimePicker extends React.PureComponent {
state: {
date: string,
time: string,

@ -35,7 +35,7 @@ function formatDateRange(start: ICAL.Time, end: ICAL.Time) {
return strStart + ' - ' + strEnd;
}
class Event extends React.Component {
class Event extends React.PureComponent {
props: {
event?: EventType,
};

@ -14,7 +14,7 @@ import * as EteSync from './api/EteSync';
import { EventType } from './pim-types';
class EventEdit extends React.Component {
class EventEdit extends React.PureComponent {
state: {
uid: string,
title: string;

@ -26,7 +26,7 @@ interface PropsType {
interface PropsTypeInner extends PropsType {
}
class Journal extends React.Component {
class Journal extends React.PureComponent {
static defaultProps = {
prevUid: null,
};

@ -14,7 +14,7 @@ function objValues(obj: any) {
return Object.keys(obj).map((x) => obj[x]);
}
class JournalAddressBook extends React.Component {
class JournalAddressBook extends React.PureComponent {
props: {
journal: EteSync.Journal,
entries: {[key: string]: ContactType},

@ -16,7 +16,7 @@ function objValues(obj: any) {
return Object.keys(obj).map((x) => obj[x]);
}
class JournalCalendar extends React.Component {
class JournalCalendar extends React.PureComponent {
props: {
journal: EteSync.Journal,
entries: {[key: string]: EventType},

@ -14,7 +14,7 @@ import { EventType, ContactType } from './pim-types';
import * as EteSync from './api/EteSync';
class JournalEntries extends React.Component {
class JournalEntries extends React.PureComponent {
static defaultProps = {
prevUid: null,
};

@ -15,7 +15,7 @@ interface FormErrors {
errorServer?: string;
}
class LoginForm extends React.Component {
class LoginForm extends React.PureComponent {
state: {
showAdvanced?: boolean;
errors: FormErrors;

@ -27,7 +27,7 @@ function objValues(obj: any) {
return Object.keys(obj).map((x) => obj[x]);
}
class Pim extends React.Component {
class Pim extends React.PureComponent {
props: {
etesync: CredentialsData;
journals: JournalsData;

@ -19,7 +19,7 @@ import { historyPersistor } from './persist-state-history';
const addressBookTitle = 'Address Book';
const calendarTitle = 'Calendar';
class PimMain extends React.Component {
class PimMain extends React.PureComponent {
props: {
contacts: Array<ContactType>,
events: Array<EventType>,

@ -10,7 +10,7 @@ import { store, StoreState, CredentialsType, fetchCredentials } from './store';
import * as C from './Constants';
class Root extends React.Component {
class Root extends React.PureComponent {
props: {
credentials: CredentialsType;
};

@ -30,7 +30,7 @@ interface PropsTypeInner extends PropsType {
history: any;
}
class SideMenu extends React.Component {
class SideMenu extends React.PureComponent {
props: PropsTypeInner;
constructor(props: any) {

@ -6,7 +6,7 @@ import * as EteSync from './api/EteSync';
import { JournalsData, CredentialsData } from './store';
class SideMenuJournals extends React.Component {
class SideMenuJournals extends React.PureComponent {
props: {
etesync: CredentialsData;
journals: JournalsData;

@ -20,7 +20,7 @@ interface PropsTypeInner extends PropsType {
entries: EntriesType;
}
class SyncGate extends React.Component {
class SyncGate extends React.PureComponent {
props: PropsTypeInner;
constructor(props: any) {

Loading…
Cancel
Save