Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. const TodoHeader = ({ addTodo }) => (
  2. <header class='header'>
  3. <h1>todos</h1>
  4. <input
  5. class='new-todo'
  6. placeholder='What needs to be done?'
  7. onKeyUp={({target, keyCode}) => {
  8. let title;
  9. if (!(keyCode === ENTER_KEY
  10. && (title = target.value.trim()))) return;
  11. addTodo({title});
  12. target.value = '';
  13. }}
  14. />
  15. </header>
  16. );
  17.  
  18. const TodoFooter = ({ store, clearCompleted }) => (
  19. <footer class='footer'>
  20. <span class='todo-count'>
  21. <strong>{(store.remainingCount)}</strong>
  22. {(store.remainingCount === 1 ? ' item' : ' items')} left
  23. </span>
  24. <ul class='filters'>
  25. <li><a
  26. href='#/'
  27. classList={({selected: store.showMode === 'all'})}
  28. >All</a</li>
  29. <li><a
  30. href='#/active'
  31. classList={({selected: store.showMode === 'active'})}
  32. >Active</a></li>
  33. <li><a
  34. href='#/completed'
  35. classList={({selected: store.showMode === 'completed'})}
  36. >Completed</a></li>
  37. </ul>
  38. <$ when={ store.completedCount > 0 }>
  39. <button
  40. class='clear-completed'
  41. onClick={clearCompleted}
  42. >Clear completed</button>
  43. </$>
  44. </footer>
  45. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement