File tree Expand file tree Collapse file tree 4 files changed +40
-5
lines changed Expand file tree Collapse file tree 4 files changed +40
-5
lines changed Original file line number Diff line number Diff line change 88 .loaded {
99 opacity : 1 ;
1010 }
11+ .input-group {
12+ margin-bottom : 15px ;
13+ }
1114 </ style >
1215</ head >
1316< body >
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ var App = React.createClass({
2525 To-Do List
2626 </ h2 >
2727 < Header itemsStore = { this . firebaseRefs . items } />
28+ < hr />
2829 < div className = { "content " + ( this . state . loaded ? 'loaded' : '' ) } >
2930 < List items = { this . state . items } />
3031 </ div >
Original file line number Diff line number Diff line change 1+ var React = require ( 'react' ) ;
2+
3+ module . exports = React . createClass ( {
4+ getInitialState : function ( ) {
5+ return {
6+ text : this . props . item . text
7+ }
8+ } ,
9+ render : function ( ) {
10+ return < div className = "input-group" >
11+ < span className = "input-group-addon" >
12+ < input type = "checkbox" />
13+ </ span >
14+ < input type = "text"
15+ className = "form-control"
16+ value = { this . state . text }
17+ />
18+ < span className = "input-group-btn" >
19+ < button className = "btn btn-default" >
20+ Delete
21+ </ button >
22+ </ span >
23+ </ div >
24+ }
25+ } ) ;
Original file line number Diff line number Diff line change 11var React = require ( 'react' ) ;
2+ var ListItem = require ( './list-item' ) ;
23
34module . exports = React . createClass ( {
45 render : function ( ) {
5- return < ul >
6+ return < div >
67 { this . renderList ( ) }
7- </ ul >
8+ </ div >
89 } ,
910 renderList : function ( ) {
1011 if ( this . props . items && Object . keys ( this . props . items ) . length === 0 ) {
@@ -15,10 +16,15 @@ module.exports = React.createClass({
1516 var children = [ ] ;
1617
1718 for ( var key in this . props . items ) {
19+ var item = this . props . items [ key ] ;
20+ item . key = key ;
21+
1822 children . push (
19- < li >
20- { this . props . items [ key ] . text }
21- </ li >
23+ < ListItem
24+ item = { item }
25+ key = { key }
26+ >
27+ </ ListItem >
2228 )
2329 }
2430
You can’t perform that action at this time.
0 commit comments