Use the new MUI-like List API.

We had to change away from MUI because the list efficiency was abysmal.
Everything is an order of magnitude faster now.
master
Tom Hacohen 7 years ago
parent fdaef3a9f7
commit 87e670ac97

@ -63,16 +63,13 @@ class AddressBook extends React.PureComponent {
return ( return (
<ListItem <ListItem
key={uid} key={uid}
onClick={(e: any) => { leftIcon={
e.preventDefault();
this.props.onItemClick(entry);
}}
>
<Avatar style={{backgroundColor: getContactColor(entry)}}> <Avatar style={{backgroundColor: getContactColor(entry)}}>
{name[0].toUpperCase()} {name[0].toUpperCase()}
</Avatar> </Avatar>}
{name} primaryText={name}
</ListItem> onClick={(e: any) => this.props.onItemClick(entry)}
/>
); );
}); });

@ -15,7 +15,6 @@ export const Avatar = pure((props: { children: React.ReactNode[] | React.ReactNo
borderRadius: '50%', borderRadius: '50%',
height: size, height: size,
width: size, width: size,
marginRight: 15,
...props.style, ...props.style,
}} }}
> >

@ -1,8 +1,7 @@
import * as React from 'react'; import * as React from 'react';
import * as moment from 'moment'; import * as moment from 'moment';
import { List, ListItem } from 'material-ui/List'; import { List, ListItem, ListDivider as Divider } from './List';
import Divider from 'material-ui/Divider';
import IconHome from 'material-ui/svg-icons/action/home'; import IconHome from 'material-ui/svg-icons/action/home';
import IconDate from 'material-ui/svg-icons/action/date-range'; import IconDate from 'material-ui/svg-icons/action/date-range';
import CommunicationCall from 'material-ui/svg-icons/communication/call'; import CommunicationCall from 'material-ui/svg-icons/communication/call';
@ -150,6 +149,7 @@ class Contact extends React.PureComponent {
<span style={{fontSize: '90%'}}>{lastModified}</span> <span style={{fontSize: '90%'}}>{lastModified}</span>
)} )}
</PimItemHeader> </PimItemHeader>
<div style={{padding: 8}} />
{lists.map((list, idx) => ( {lists.map((list, idx) => (
<React.Fragment key={idx}> <React.Fragment key={idx}>
{listIfNotEmpty(list)} {listIfNotEmpty(list)}

@ -1,7 +1,7 @@
import * as Immutable from 'immutable'; import * as Immutable from 'immutable';
import * as React from 'react'; import * as React from 'react';
import { List, ListItem } from 'material-ui/List'; import { List, ListItem } from './List';
import Dialog from 'material-ui/Dialog'; import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton'; import FlatButton from 'material-ui/FlatButton';
import IconAdd from 'material-ui/svg-icons/content/add'; import IconAdd from 'material-ui/svg-icons/content/add';

@ -1,9 +1,7 @@
import * as React from 'react'; import * as React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
import { List, ListItem } from 'material-ui/List'; import { List, ListItem, ListSubheader, ListDivider } from './List';
import Subheader from 'material-ui/Subheader';
import Divider from 'material-ui/Divider';
import ActionCode from 'material-ui/svg-icons/action/code'; import ActionCode from 'material-ui/svg-icons/action/code';
import ActionHome from 'material-ui/svg-icons/action/home'; import ActionHome from 'material-ui/svg-icons/action/home';
import ActionBugReport from 'material-ui/svg-icons/action/bug-report'; import ActionBugReport from 'material-ui/svg-icons/action/bug-report';
@ -52,8 +50,8 @@ class SideMenu extends React.PureComponent {
if (this.props.etesync) { if (this.props.etesync) {
const journals = (this.props.journals && this.props.journals.value) && ( const journals = (this.props.journals && this.props.journals.value) && (
<React.Fragment> <React.Fragment>
<Divider /> <ListDivider />
<Subheader>Journals</Subheader> <ListSubheader>Journals</ListSubheader>
<SideMenuJournals <SideMenuJournals
etesync={this.props.etesync} etesync={this.props.etesync}
journals={this.props.journals.value} journals={this.props.journals.value}
@ -91,8 +89,8 @@ class SideMenu extends React.PureComponent {
}} }}
/> />
{loggedInItems} {loggedInItems}
<Divider /> <ListDivider />
<Subheader>External Links</Subheader> <ListSubheader>External Links</ListSubheader>
<ListItem primaryText="Website" leftIcon={<ActionHome />} href={C.homePage} /> <ListItem primaryText="Website" leftIcon={<ActionHome />} href={C.homePage} />
<ListItem primaryText="FAQ" leftIcon={<ActionQuestionAnswer />} href={C.faq} /> <ListItem primaryText="FAQ" leftIcon={<ActionQuestionAnswer />} href={C.faq} />
<ListItem primaryText="Source Code" leftIcon={<ActionCode />} href={C.sourceCode} /> <ListItem primaryText="Source Code" leftIcon={<ActionCode />} href={C.sourceCode} />

@ -1,6 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import { ListItem } from 'material-ui/List'; import { ListItem } from './List';
import * as EteSync from './api/EteSync'; import * as EteSync from './api/EteSync';

Loading…
Cancel
Save