@@ -26,18 +26,6 @@ var Root = module.exports = React.createClass({
26
26
this . setState ( { contacts : newProps . contacts } ) ;
27
27
} ,
28
28
29
- renderContacts : function ( ) {
30
- if ( ! this . props . contacts )
31
- return null ;
32
-
33
- var contacts = this . state . contacts . records ;
34
- return contacts . map ( function ( contact ) {
35
- return < li key = { contact . id } >
36
- < Link to = "contact" params = { { id : contact . id } } > { contact . first } { contact . last } </ Link >
37
- </ li > ;
38
- } ) ;
39
- } ,
40
-
41
29
componentDidMount : function ( ) {
42
30
ContactStore . addChangeListener ( this . handleContactsChange ) ;
43
31
} ,
@@ -50,15 +38,41 @@ var Root = module.exports = React.createClass({
50
38
this . setState ( { contactData : ContactStore . getAll ( ) } ) ;
51
39
} ,
52
40
41
+ renderContacts : function ( ) {
42
+ if ( ! this . props . contacts )
43
+ return null ;
44
+
45
+ var contacts = this . state . contacts . records ;
46
+ return contacts . map ( function ( contact ) {
47
+ return (
48
+ < li key = { contact . id } >
49
+ < Link
50
+ className = "ContactList__Contact"
51
+ to = "contact"
52
+ params = { { id : contact . id } }
53
+ >
54
+ { contact . first } { contact . last }
55
+ </ Link >
56
+ </ li >
57
+ ) ;
58
+ } ) ;
59
+ } ,
60
+
53
61
render : function ( ) {
54
62
return (
55
- < div >
56
- < h1 > Address Book</ h1 >
57
- < NewContactForm />
58
- < ul >
59
- { this . renderContacts ( ) }
60
- </ ul >
61
- { this . props . activeRouteHandler ( ) }
63
+ < div className = "App" >
64
+ < div className = "Master" >
65
+ < h2 className = "Heading" > Contacts</ h2 >
66
+ < div className = "Content" >
67
+ < ul className = "ContactList" >
68
+ { this . renderContacts ( ) }
69
+ </ ul >
70
+ </ div >
71
+ </ div >
72
+
73
+ < div className = "Detail" >
74
+ { this . props . activeRouteHandler ( ) }
75
+ </ div >
62
76
</ div >
63
77
) ;
64
78
}
0 commit comments