From 2263f412817d6d2d36372e7617feb0d97fa57af8 Mon Sep 17 00:00:00 2001
From: Jules Laplace <julescarbon@gmail.com>
Date: Tue, 4 Jul 2017 02:11:44 +0200
Subject: break out browser and tasks

---
 client/components/App.jsx | 42 +++++++-----------------------------------
 1 file changed, 7 insertions(+), 35 deletions(-)

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

diff --git a/client/components/App.jsx b/client/components/App.jsx
index 85766e5..5340ba1 100644
--- a/client/components/App.jsx
+++ b/client/components/App.jsx
@@ -3,54 +3,26 @@ import { isMobile } from '../vendor/util'
 // import db from '../db'
 import { Link, withRouter } from 'react-router-dom'
 
-import Header from './Header.jsx'
-import Folders from './Folders/Folders.jsx'
-import Folder from './Folder/Folder.jsx'
+import Header from './UI/Header.jsx'
+import Browser from './Browser/Browser.jsx'
+import Tasks from './Tasks/Tasks.jsx'
 
 import client from '../client'
 
 class App extends Component {
   constructor(props) {
     super()
-    let openFolders = JSON.parse( localStorage['openFolders'] || 'null' )
     this.state = {
-      folders: [],
-      openFolders: openFolders || [],
     }
-    client.folder.index().then( folders => this.setState({ folders }) )
-  }
-  openFolder(folder) {
-    if (this.state.openFolders.indexOf(folder.id) === -1) {
-      const newOpenFolders = this.state.openFolders.concat(folder.id)
-      localStorage['openFolders'] = JSON.stringify(newOpenFolders)
-      this.setState({ openFolders: newOpenFolders })
-    }
-  }
-  closeFolder(folder) {
-    const openFolders = this.state.openFolders.filter( folder_id => folder_id !== folder.id )
-    localStorage['openFolders'] = JSON.stringify(openFolders)
-    this.setState({ openFolders })
-  }
-  addFolder(folder) {
-    this.setState({ folders: this.state.folders.concat([folder]) })
   }
   render() {
-    const openFolders = this.state.openFolders.map((folder_id) => {
-      const folder_list = this.state.folders.filter(folder => folder.id === folder_id)
-      if (! folder_list.length) return
-      const folder = folder_list[0]
-      return (
-        <Folder
-          folder={folder}
-          onClose={() => this.closeFolder(folder)}
-        />
-      )
-    })
     return (
       <div>
         <Header />
-        <Folders folders={this.state.folders} openFolder={(folder) => this.openFolder(folder)} addFolder={(folder) => this.addFolder(folder)} />
-        {openFolders}
+        <div class='columns'>
+          <Browser />
+          <Tasks />
+        </div>
       </div>
     )
   }
-- 
cgit v1.2.3-70-g09d2

