File tree Expand file tree Collapse file tree 7 files changed +78
-9
lines changed Expand file tree Collapse file tree 7 files changed +78
-9
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,21 @@ export default class Todo extends React.Component {
7
7
super ( ) ;
8
8
}
9
9
10
+ // Anna Code Start
10
11
removeTodo ( e ) {
11
- // console.log(this.props.id);
12
- //REMOVE BY ID
13
12
TodoActions . deleteTodo ( this . props . id ) ;
14
13
}
15
-
14
+ // Anna Code End
15
+ // const icon = complete ? "\u2714" : "\u2716"
16
16
render ( ) {
17
17
const { complete, edit, text } = this . props ;
18
18
19
- const icon = complete ? "\u2714" : "\u2716"
19
+ const icon = complete ? "../../assets/icon_done.svg" : "../../assets/icon_not_done.svg" ;
20
+ const trash = "../../assets/icon_trash.svg" ;
21
+ const iconStyle = {
22
+ maxWidth : "50px" ,
23
+ padding : "5px"
24
+ } ;
20
25
21
26
if ( edit ) {
22
27
return (
@@ -28,7 +33,8 @@ export default class Todo extends React.Component {
28
33
29
34
return (
30
35
< li >
31
- < button onClick = { this . removeTodo . bind ( this ) } > { icon } </ button >
36
+ < span > < img style = { iconStyle } src = { icon } /> </ span >
37
+ < span onClick = { this . removeTodo . bind ( this ) } > < img style = { iconStyle } src = { trash } /> </ span >
32
38
< span > { text } </ span >
33
39
</ li >
34
40
) ;
Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ export default class Todos extends React.Component {
52
52
return < Todo key = { todo . id } { ...todo } /> ;
53
53
} ) ;
54
54
55
+ const customUl = {
56
+ listStyle : "none" ,
57
+ paddingLeft : "0"
58
+ } ;
59
+
55
60
return (
56
61
< div >
57
62
< button onClick = { this . reloadTodos . bind ( this ) } > Reload!</ button >
@@ -60,7 +65,7 @@ export default class Todos extends React.Component {
60
65
< input type = "text" value = { this . state . newTodo } onChange = { this . handleChange . bind ( this ) } />
61
66
< button onClick = { this . addTodo . bind ( this ) } > Add Todo</ button >
62
67
</ form >
63
- < ul > { TodoComponents } </ ul >
68
+ < ul style = { customUl } > { TodoComponents } </ ul >
64
69
</ div >
65
70
) ;
66
71
}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class TodoStore extends EventEmitter {
9
9
{
10
10
id : 113464613 ,
11
11
text : "Go Shopping" ,
12
- complete : false
12
+ complete : true
13
13
} ,
14
14
{
15
15
id : 235684679 ,
@@ -27,14 +27,14 @@ class TodoStore extends EventEmitter {
27
27
text,
28
28
complete : false ,
29
29
} ) ;
30
- this . emit ( "change" ) ;
30
+ // this.emit("change");
31
31
}
32
32
33
33
deleteTodo ( id ) {
34
34
this . todos = this . todos . filter ( ( entry ) => {
35
35
return entry . id !== id ;
36
36
} ) ;
37
- this . emit ( "change" ) ;
37
+ // this.emit("change");
38
38
}
39
39
40
40
getAll ( ) {
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+ playNice ( ) {
3
+
4
+ }
You can’t perform that action at this time.
0 commit comments