From f8b61281be84a6e4e7a44be5109e688a7c56c671 Mon Sep 17 00:00:00 2001
From: Jules Laplace <julescarbon@gmail.com>
Date: Fri, 7 Jul 2017 21:18:33 +0200
Subject: refactor files so list updates while processing

---
 client/components/Tasks/Tasks.jsx | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

(limited to 'client/components/Tasks/Tasks.jsx')

diff --git a/client/components/Tasks/Tasks.jsx b/client/components/Tasks/Tasks.jsx
index 263e669..79ee0a1 100644
--- a/client/components/Tasks/Tasks.jsx
+++ b/client/components/Tasks/Tasks.jsx
@@ -2,31 +2,10 @@ import { h, Component } from 'preact'
 import { Link } from 'react-router-dom'
 
 import TaskForm from '../../containers/taskForm.js'
-
-import client from '../../client.js'
+import TaskList from '../../containers/taskList.js'
 
 export default class Tasks extends Component {
-  constructor(props) {
-    super()
-    this.state = {
-      adding: false,
-      tasks: [],
-    }
-    client.task.index().then( tasks => this.setState({ tasks }) )
-  }
   render() {
-//           <span class='name'>{task.result_file.name}</span>
-    const tasks = (this.state.tasks || []).map( (task, i) => {
-      return (
-        <div key={i} onClick={() => this.toggle(task)}>
-          <span>{task.id}</span>
-          <span>{task.created_at}</span>
-          <span class='name'>{task.content_file.name}</span>
-          <span class='name'>{task.style_file.name}</span>
-          <span>{task.alpha}</span>
-        </div>
-      )
-    })
     return (
       <div class='column'>
         <div class='window'>
@@ -39,9 +18,7 @@ export default class Tasks extends Component {
           <div class='heading'>
             <b>recent tasks</b>
           </div>
-          <div class='list'>
-            {tasks}
-          </div>
+          <TaskList />
         </div>
       </div>
     )
-- 
cgit v1.2.3-70-g09d2

