diff --git a/src/AddressBook.tsx b/src/AddressBook.tsx index 0e6cd74..01181da 100644 --- a/src/AddressBook.tsx +++ b/src/AddressBook.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; -import Avatar from 'material-ui/Avatar'; -import { List, ListItem } from 'material-ui/List'; import * as colors from 'material-ui/styles/colors'; +import { List, ListItem } from './List'; + import { ContactType } from './pim-types'; class AddressBook extends React.PureComponent { @@ -61,22 +61,34 @@ class AddressBook extends React.PureComponent { let itemProps: any = { leftAvatar: ( - {name[0].toUpperCase()} - + ), }; return ( (this.props.onItemClick(entry))} - {...itemProps} - /> + onClick={(e: any) => { + e.preventDefault(); + this.props.onItemClick(entry); + }} + > + {itemProps.leftAvatar} {name} + ); }); diff --git a/src/List.css b/src/List.css new file mode 100644 index 0000000..80f489d --- /dev/null +++ b/src/List.css @@ -0,0 +1,14 @@ +.List { + list-style: none; + padding: 0; +} + +.ListItem { + padding: 10px; +} + +.ListItem:hover { + background-color: rgba(0, 0, 0, 0.1); + cursor: pointer; +} + diff --git a/src/List.tsx b/src/List.tsx new file mode 100644 index 0000000..f893a91 --- /dev/null +++ b/src/List.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; +import { pure } from 'recompose'; + +import './List.css'; + +export const ListItem = pure((props: any) => ( +
  • + {props.children} +
  • +)); + +export const List = pure((props: { children: React.ReactNode[] | React.ReactNode }) => ( + +));