Skip to content

Commit e731f7a

Browse files
build clear completed link
1 parent d59c3d0 commit e731f7a

File tree

1 file changed

+4
-2
lines changed
  • ep13-clear-completed/app/components

1 file changed

+4
-2
lines changed

ep13-clear-completed/app/components/App.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ export default class App extends React.Component {
5555
</form>
5656

5757
<p>
58-
Number of total tasks: { this.state.todos.length }
58+
All: ({ this.state.todos.length }) |
59+
Completed: ({ this.state.todos.filter((todo) => { return todo.done }).length }) |
60+
Pending: ({ this.state.todos.filter((todo) => { return !todo.done }).length }) |
61+
<a href='#'>Clear Completed</a>
5962
</p>
6063
<p>
61-
Number of total tasks done: { this.state.todos.filter((todo) => { return todo.done }).length }
6264
</p>
6365

6466
<DisplayList

0 commit comments

Comments
 (0)