diff --git a/3-flux/documentation/Untitled.pdf b/3-flux/documentation/Untitled.pdf deleted file mode 100644 index 752c3649..00000000 Binary files a/3-flux/documentation/Untitled.pdf and /dev/null differ diff --git a/3-flux/documentation/data-flow.graffle b/3-flux/documentation/data-flow.graffle new file mode 100644 index 00000000..c671be1b Binary files /dev/null and b/3-flux/documentation/data-flow.graffle differ diff --git a/3-flux/documentation/data-flow.pdf b/3-flux/documentation/data-flow.pdf index 5f1ac87b..33da260d 100644 Binary files a/3-flux/documentation/data-flow.pdf and b/3-flux/documentation/data-flow.pdf differ diff --git a/3-flux/src/assets/icon_done.svg b/3-flux/src/assets/icon_done.svg index 92cb5ace..43410f27 100644 --- a/3-flux/src/assets/icon_done.svg +++ b/3-flux/src/assets/icon_done.svg @@ -1,8 +1,12 @@ - + @@ -10,8 +14,11 @@ - - + + + + + diff --git a/3-flux/src/assets/icon_not_done.svg b/3-flux/src/assets/icon_not_done.svg index c133fdcd..f9e29e72 100644 --- a/3-flux/src/assets/icon_not_done.svg +++ b/3-flux/src/assets/icon_not_done.svg @@ -1,8 +1,12 @@ - + @@ -10,8 +14,8 @@ - - + + diff --git a/3-flux/src/js/actions/TodoActions.js b/3-flux/src/js/actions/TodoActions.js index 6c32a464..4586c14b 100644 --- a/3-flux/src/js/actions/TodoActions.js +++ b/3-flux/src/js/actions/TodoActions.js @@ -1,16 +1,16 @@ import dispatcher from "../dispatcher"; -export function createTodo(text) { +export function deleteTodo(id) { dispatcher.dispatch({ - type: "CREATE_TODO", - text, + type: "DELETE_TODO", + id, }); } -export function deleteTodo(id) { +export function createTodo(text) { dispatcher.dispatch({ - type: "DELETE_TODO", - id, + type: "CREATE_TODO", + text, }); } diff --git a/3-flux/src/js/components/NewTodo.js b/3-flux/src/js/components/NewTodo.js index 20cdb157..b6397f8b 100644 --- a/3-flux/src/js/components/NewTodo.js +++ b/3-flux/src/js/components/NewTodo.js @@ -5,12 +5,51 @@ import * as TodoActions from "../actions/TodoActions"; export default class NewTodo extends React.Component { constructor(props) { super(); + this.state = { + newTodo: "" + }; + } + + addTodo(e) { + e.preventDefault(); + TodoActions.createTodo(this.state.newTodo); + this.setState({newTodo: ""}); + } + + handleChange(e) { + this.setState({newTodo: e.target.value}); } render() { + const inputStyling = { + borderRadius: "10px", + borderStyle: "solid", + borderWidth: "1px", + borderColor: "#B19FBA", + marginRight: "20px", + minWidth: "200px", + backgroundColor: "#D8CFDD", + padding: "3px 15px 3px 15px" + }; - return ( + const formStyling = { + paddingBottom: "10px" + }; + + const standardButton = { + borderRadius: "10px", + borderStyle: "none", + padding: "3px 15px 3px 15px", + fontFamily: "Roboto", + backgroundColor: "#765786", + color: "#FFF" + }; + return ( +
+
); } } diff --git a/3-flux/src/js/components/Todo.js b/3-flux/src/js/components/Todo.js index 6100978b..6a7043a2 100644 --- a/3-flux/src/js/components/Todo.js +++ b/3-flux/src/js/components/Todo.js @@ -7,12 +7,10 @@ export default class Todo extends React.Component { super(); } -// Anna Code Start - removeTodo(e) { + deleteTodo(e) { TodoActions.deleteTodo(this.props.id); } -// Anna Code End - // const icon = complete ? "\u2714" : "\u2716" + render() { const { complete, edit, text } = this.props; @@ -23,6 +21,11 @@ export default class Todo extends React.Component { padding: "5px" }; + const checkboxStyle = { + maxWidth: "50px", + padding: "10px" + } + if (edit) { return (
  • @@ -33,8 +36,8 @@ export default class Todo extends React.Component { return (
  • - - + + {text}
  • ); diff --git a/3-flux/src/js/pages/Todos.js b/3-flux/src/js/pages/Todos.js index 2eea1929..0e3a48dc 100644 --- a/3-flux/src/js/pages/Todos.js +++ b/3-flux/src/js/pages/Todos.js @@ -1,7 +1,7 @@ import React from "react"; import Todo from "../components/Todo"; -import NewTodo from "../components/Todo"; +import NewTodo from "../components/NewTodo"; import * as TodoActions from "../actions/TodoActions"; import TodoStore from "../stores/TodoStore"; @@ -10,8 +10,7 @@ export default class Todos extends React.Component { super(); this.getTodos = this.getTodos.bind(this); this.state = { - todos: TodoStore.getAll(), - newTodo: "" + todos: TodoStore.getAll() }; } @@ -33,19 +32,6 @@ export default class Todos extends React.Component { TodoActions.reloadTodos(); } - // Start Anna Code - addTodo(e) { - console.log("??"); - e.preventDefault(); - TodoActions.createTodo(this.state.newTodo); - this.setState({newTodo: ""}); - } - - handleChange(e) { - this.setState({newTodo: e.target.value}); - } - // End Anna Code - render() { const { todos } = this.state; @@ -64,37 +50,10 @@ export default class Todos extends React.Component { marginBottom: "20px" }; - const inputStyling = { - borderRadius: "10px", - borderStyle: "solid", - borderWidth: "1px", - borderColor: "#B19FBA", - marginRight: "20px", - minWidth: "200px", - backgroundColor: "#D8CFDD", - padding: "3px 15px 3px 15px" - } - - const formStyling = { - paddingBottom: "10px" - } - - const standardButton = { - borderRadius: "10px", - borderStyle: "none", - padding: "3px 15px 3px 15px", - fontFamily: "Roboto", - backgroundColor: "#765786", - color: "#FFF" - } - return (

    A List of things To Do

    -
    - - -
    +
    );