diff --git a/src/components/TodoList.js b/src/components/TodoList.js index 5d3a6da..da20f0d 100644 --- a/src/components/TodoList.js +++ b/src/components/TodoList.js @@ -1,21 +1,14 @@ import React from 'react'; import Li from './Li.js'; import AddTodoForm from './AddtodoForm.js'; - import 'bootstrap/dist/css/bootstrap.css'; - - - +import dotoJson from '../server/data/todolist.js'; class TodoList extends React.Component { constructor(props){ super(props) this.state = { - todoList : [ - {id: 123, todo: 'Clean the bathroom' , at:'2020', isDone: false}, - {id: 124, todo: 'Buy Milk', at:'2019', isDone: true}, - {id: 129, todo: 'Walk the dog' , at:'2018', isDone: false} - ], + todoList : dotoJson, nextTodoValue: '', isCheckAll: false, checkAllToggleName: 'checkAll' diff --git a/src/server/data/todolist.js b/src/server/data/todolist.js new file mode 100644 index 0000000..00263d0 --- /dev/null +++ b/src/server/data/todolist.js @@ -0,0 +1,6 @@ + const dotoJson = [ + {id: 123, todo: 'Clean the bathroom' , at:'2020', isDone: false}, + {id: 124, todo: 'Buy Milk', at:'2019', isDone: true}, + {id: 129, todo: 'Walk the dog' , at:'2018', isDone: false} + ] +export default dotoJson