diff --git a/src/App.js b/src/App.js
index e358583..57996ca 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,11 +1,24 @@
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
}>
+
+
+
);
}
diff --git a/src/components/Todo/Todo.css b/src/components/Todo/Todo.css
new file mode 100644
index 0000000..fdac7ad
--- /dev/null
+++ b/src/components/Todo/Todo.css
@@ -0,0 +1,31 @@
+.Todo {
+ border-top: 1px solid #f1f3f5;
+ padding: 1rem;
+ display: flex;
+ align-items: center;
+ transition: all 0.15s;
+}
+
+.Todo .text {
+ flex: 1;
+ text-align: left;
+ word-break: break-all;
+ cursor: pointer;
+}
+
+.Todo .text:hover {
+ color: orange;
+}
+
+.Todo .done {
+ text-decoration: line-through;
+ color: #adb5bd;
+}
+
+.Todo .done-mark {
+ font-size: 1.5rem;
+ line-height: 1rem;
+ margin-left: 1rem;
+ color: orange;
+ font-weight: 800;
+}
diff --git a/src/components/Todo/Todo.js b/src/components/Todo/Todo.js
new file mode 100644
index 0000000..7bf8016
--- /dev/null
+++ b/src/components/Todo/Todo.js
@@ -0,0 +1,14 @@
+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.css b/src/components/TodoDetail/TodoDetail.css
new file mode 100644
index 0000000..d343aac
--- /dev/null
+++ b/src/components/TodoDetail/TodoDetail.css
@@ -0,0 +1,15 @@
+.TodoDetail .row {
+ display: flex;
+ padding: 20px;
+ height: 30px;
+ text-align: left;
+}
+
+.TodoDetail .left {
+ font-weight: bold;
+ flex: 25%;
+}
+
+.TodoDetail .right {
+ flex: 75%;
+}
diff --git a/src/components/TodoDetail/TodoDetail.js b/src/components/TodoDetail/TodoDetail.js
new file mode 100644
index 0000000..c886936
--- /dev/null
+++ b/src/components/TodoDetail/TodoDetail.js
@@ -0,0 +1,25 @@
+import React from 'react';
+import './TodoDetail.css';
+const TodoDetail = (props) => {
+ return (
+
+
+
+ Name:
+
+
+ {props.title}
+
+
+
+
+ Content:
+
+
+ {props.content}
+
+
+
+ );
+};
+export default TodoDetail;
\ No newline at end of file
diff --git a/src/containers/TodoList/NewTodo/NewTodo.css b/src/containers/TodoList/NewTodo/NewTodo.css
new file mode 100644
index 0000000..0967d20
--- /dev/null
+++ b/src/containers/TodoList/NewTodo/NewTodo.css
@@ -0,0 +1,41 @@
+.NewTodo {
+ width: 80%;
+ margin: 20px auto;
+ border: 1px solid #eee;
+ box-shadow: 0 2px 3px #ccc;
+ text-align: center;
+}
+
+.NewTodo label {
+ display: block;
+ margin: 10px auto;
+ text-align: center;
+ font-weight: bold;
+}
+
+.NewTodo input,
+.NewTodo textarea {
+ display: block;
+ width: 80%;
+ box-sizing: border-box;
+ border: 1px solid black;
+ outline: none;
+ font: inherit;
+ margin: auto;
+}
+
+.NewTodo button {
+ margin: 5px 0;
+ padding: 10px;
+ font: inherit;
+ border: 1px solid #fa923f;
+ background-color: transparent;
+ color: #fa923f;
+ cursor: pointer;
+}
+
+.NewTodo button:active,
+.NewTodo button:hover {
+ color: white;
+ background-color: #fa923f;
+}
diff --git a/src/containers/TodoList/NewTodo/NewTodo.js b/src/containers/TodoList/NewTodo/NewTodo.js
new file mode 100644
index 0000000..e8e2458
--- /dev/null
+++ b/src/containers/TodoList/NewTodo/NewTodo.js
@@ -0,0 +1,45 @@
+import React, {Component} from 'react';
+import './NewTodo.css';
+import { Redirect } from 'react-router-dom';
+
+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 });
+ this.props.history.push('/todos');
+ }
+
+ render() {
+ if (this.state.submitted) {
+ return
+ }
+
+ 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.css b/src/containers/TodoList/TodoList.css
new file mode 100644
index 0000000..6038cb5
--- /dev/null
+++ b/src/containers/TodoList/TodoList.css
@@ -0,0 +1,16 @@
+.TodoList {
+ background: white;
+ width: 512px;
+ box-shadow: 0 3px 9px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
+ /* 그림자 */
+ margin: 4rem auto auto;
+}
+
+.TodoList .title {
+ padding: 2rem;
+ font-size: 2.5rem;
+ text-align: center;
+ font-weight: 500;
+ background: orange;
+ color: black;
+}
diff --git a/src/containers/TodoList/TodoList.js b/src/containers/TodoList/TodoList.js
new file mode 100644
index 0000000..7fa0081
--- /dev/null
+++ b/src/containers/TodoList/TodoList.js
@@ -0,0 +1,51 @@
+import React, { Component } from 'react';
+import TodoDetail from '../../components/TodoDetail/TodoDetail'
+import Todo from '../../components/Todo/Todo';
+//import NewTodo from './NewTodo/NewTodo'
+import { NavLink } from 'react-router-dom';
+import "./TodoList.css"
+
+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) {
+ // BAD: this.state.selectedTodo = null; it won't trigger rendering.
+ this.setState({ selectedTodo: null });
+ } else {
+ this.setState({ selectedTodo: td });
+ }
+ }
+
+ render() {
+ const todos = this.state.todos.map((td) => {
+ return ( this.clickTodoHandler(td)} />);
+ });
+
+ let todoDetail = null;
+ if (this.state.selectedTodo) {
+ todoDetail =
+ }
+
+ return (
+
+
{this.props.title}
+
{todos}
+ {todoDetail}
+
New Todo
+
+ );
+ }
+}
+export default TodoList;
\ No newline at end of file