diff --git a/src/App.js b/src/App.js
index e358583..f62e44f 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,12 +1,26 @@
import React from 'react';
-import logo from './logo.svg';
import './App.css';
+import TodoList from './containers/TodoList/TodoList';
+import TodoDetail from './components/TodoDetail/TodoDetail';
+import NewTodo from './containers/TodoList/NewTodo/NewTodo';
+
+import { BrowserRouter, Route, Redirect, Switch } from 'react-router-dom';
+
function App() {
return (
-
-
+
+
+
+ } />
+
+
+
+ Not Found
} />
+
+
+
);
}
-export default App;
+export default App;
\ No newline at end of file
diff --git a/src/components/Todo/Todo.js b/src/components/Todo/Todo.js
index e69de29..ddae302 100644
--- a/src/components/Todo/Todo.js
+++ b/src/components/Todo/Todo.js
@@ -0,0 +1,18 @@
+import React from 'react';
+
+import './Todo.css';
+
+const Todo = (props) => {
+ return (
+
+
+ {props.title}
+
+ {props.done &&
✓
}
+
+ );
+};
+
+export default Todo;
\ No newline at end of file
diff --git a/src/components/TodoDetail/TodoDetail.js b/src/components/TodoDetail/TodoDetail.js
index e69de29..f329442 100644
--- a/src/components/TodoDetail/TodoDetail.js
+++ b/src/components/TodoDetail/TodoDetail.js
@@ -0,0 +1,34 @@
+import React from 'react';
+
+import './TodoDetail.css';
+
+class TodoDetail extends React.Component {
+ render() {
+ if (this.props.match) {
+ console.log(this.props.match.params.id);
+ }
+ return (
+ < div className="TodoDetail" >
+
+
+ Name:
+
+
+ {this.props.title}
+
+
+
+
+
+ Content:
+
+
+ {this.props.content}
+
+
+
+ );
+ }
+};
+
+export default TodoDetail;
\ No newline at end of file
diff --git a/src/containers/TodoList/NewTodo/NewTodo.js b/src/containers/TodoList/NewTodo/NewTodo.js
index e69de29..bcf91f1 100644
--- a/src/containers/TodoList/NewTodo/NewTodo.js
+++ b/src/containers/TodoList/NewTodo/NewTodo.js
@@ -0,0 +1,41 @@
+import React, { Component } from 'react';
+
+import { Redirect } from 'react-router-dom';
+
+import './NewTodo.css';
+
+class NewTodo extends Component {
+ state = {
+ title: '',
+ content: '',
+ submitted: false,
+ }
+
+ postTodoHandler = () => {
+ const data = { title: this.state.title, content: this.state.content };
+ alert('Submitted\n' + data.title + '\n' + data.content);
+ this.setState({ submitted: true });
+ }
+
+ render() {
+ let redirect = null;
+ if (this.state.submitted) {
+ redirect =
+ }
+ return (
+
+ {redirect}
+
Add a Todo
+
+ this.setState({ title: event.target.value })} />
+
+
+ );
+ }
+}
+
+export default NewTodo;
\ No newline at end of file
diff --git a/src/containers/TodoList/TodoList.js b/src/containers/TodoList/TodoList.js
index e69de29..4a56d3b 100644
--- a/src/containers/TodoList/TodoList.js
+++ b/src/containers/TodoList/TodoList.js
@@ -0,0 +1,56 @@
+import React, { Component } from 'react';
+
+import Todo from '../../components/Todo/Todo';
+import TodoDetail from '../../components/TodoDetail/TodoDetail';
+import './TodoList.css';
+
+import { NavLink } from 'react-router-dom';
+
+class TodoList extends Component {
+ state = {
+ todos: [
+ { id: 1, title: 'SWPP', content: 'take swpp class', done: true },
+ { id: 2, title: 'Movie', content: 'watch movie', done: false },
+ { id: 3, title: 'Dinner', content: 'eat dinner', done: false }
+ ],
+ selectedTodo: null,
+ }
+
+ clickTodoHandler = (td) => {
+ if (this.state.selectedTodo === td) {
+ this.setState({ ...this.state, selectedTodo: null });
+ } else {
+ this.setState({ ...this.state, selectedTodo: td });
+ }
+ }
+
+ render() {
+ const todos = this.state.todos.map((td) => {
+ return (
+ this.clickTodoHandler(td)}
+ />);
+ });
+
+ let todo = null;
+ if (this.state.selectedTodo) {
+ todo =
+ }
+ return (
+
+
{this.props.title}
+
{todos}
+ {todo}
+
New Todo
+
+ )
+ }
+}
+
+export default TodoList;
\ No newline at end of file