Skip to content

Commit

Permalink
Added Todo List snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
mantasoff committed Nov 21, 2019
1 parent ddd9c2c commit 40c210b
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/components/TodoListCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,35 @@ import React from 'react';
import history from '../history';

class TodoListCard extends React.Component {
renderSnippet = () => {
const filteredTodoList = this.props.TodoList.todoList.filter(todo => {
if(!todo.isDone) return true;
return false;
});

return filteredTodoList.map(todo => {
return(
<div className="event">
<div className="content">
<div className="summary">
{todo.name}
</div>
</div>
</div>
);
})
}

render() {
return (
<div className="ui link card" onClick={() => history.push(`/todo/${this.props.TodoList.id}`)}>
<div className="content">
<div className="header">{this.props.TodoList.name}</div>
</div>
<div className="content">
<div className="ui sub header">ToDo</div>
<div className="ui small feed">
<div className="content">
<div className="summary">
This is a summary
</div>
</div>
<div className="ui sub header">Tasks</div>
<div className="ui small feed">
{this.renderSnippet()}
</div>
</div>
</div>
Expand Down

0 comments on commit 40c210b

Please sign in to comment.