File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
ep17-edit-todo/app/components Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,17 @@ export default class DisplayItem extends React.Component {
10
10
render ( ) {
11
11
var todo = this . props . todo ;
12
12
13
- return < div >
14
- < li className = { todo . done ? 'done' : '' } >
13
+ var viewStyle = { } ;
14
+ var editStyle = { } ;
15
+
16
+ if ( this . state . editing ) {
17
+ viewStyle . display = 'none' ;
18
+ } else {
19
+ editStyle . display = 'none' ;
20
+ }
21
+
22
+ return < li className = { todo . done ? 'done' : '' } >
23
+ < div style = { viewStyle } >
15
24
< input
16
25
checked = { todo . done }
17
26
onChange = { this . props . handleDone . bind ( null , todo . id ) }
@@ -27,14 +36,12 @@ export default class DisplayItem extends React.Component {
27
36
onClick = { this . props . handleDelete . bind ( null , todo . id ) } >
28
37
[x]
29
38
</ a >
39
+ </ div >
30
40
31
- < input type = "text"
32
- value = { todo . title } />
33
- </ li >
34
-
35
- </ div >
36
-
37
-
41
+ < input type = "text"
42
+ style = { editStyle }
43
+ value = { todo . title } />
44
+ </ li >
38
45
}
39
46
40
47
}
You can’t perform that action at this time.
0 commit comments