Browse Source

Step 8.1: Add hide completed checkbox to App component.

Frederic G. MARAND 8 years ago
parent
commit
c761572472
1 changed files with 7 additions and 0 deletions
  1. 7 0
      App.jsx

+ 7 - 0
App.jsx

@@ -43,6 +43,13 @@ App = React.createClass({
         <header>
           <h1>Todo list</h1>
 
+          <label className="hide-completed">
+            <input type="checkbox" readonly={true}
+                   checked={this.state.hideCompleted}
+                   onClick={this.toggleHideCompleted} />
+            Hide completed
+          </label>
+
           {/* These are JSX comments. */}
           {/* Beware: for React, onsubmit is not the same as onSubmit, the former doesn't work */}
           <form className="new-task" onSubmit={this.handleSubmit} >