display todos reversed

This commit is contained in:
2018-06-03 15:51:06 +03:00
parent f5b1af5e78
commit 9d280f6b91
3 changed files with 6 additions and 3 deletions

View File

@@ -133,9 +133,9 @@ export function fetchLists() {
newObj[list.id] = {
dirty: true,
fetching: false,
todos: null,
editing: false,
...list,
todos: [...list.todos.reverse()],
};
return newObj;
}, {});

View File

@@ -71,7 +71,7 @@ class Todo extends React.Component {
) : (
<button
className={todoClasses.join(' ')}
onClick={this.state.hover && this.props.toggleTodo}
onClick={this.state.hover ? this.props.toggleTodo : null}
>
{this.props.todo.text}
</button>

View File

@@ -32,6 +32,9 @@ function mapDispatchToProps(dispatch) {
};
}
const TodosContainer = connect(mapStateToProps, mapDispatchToProps)(TodoList);
const TodosContainer = connect(
mapStateToProps,
mapDispatchToProps,
)(TodoList);
export default TodosContainer;