From 2f2c1ef4029dee17be0d16acdd60b7d1718d519f Mon Sep 17 00:00:00 2001
From: Jules Laplace <julescarbon@gmail.com>
Date: Wed, 19 Jul 2017 02:06:56 +0200
Subject: refactor file browser stuff

---
 client/components/Browser/Folders/Folders.jsx | 56 ---------------------------
 1 file changed, 56 deletions(-)
 delete mode 100644 client/components/Browser/Folders/Folders.jsx

(limited to 'client/components/Browser/Folders/Folders.jsx')

diff --git a/client/components/Browser/Folders/Folders.jsx b/client/components/Browser/Folders/Folders.jsx
deleted file mode 100644
index 2c85e80..0000000
--- a/client/components/Browser/Folders/Folders.jsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import { h, Component } from 'preact'
-
-import Modal from '../../UI/Modal.jsx'
-import FolderForm from './FolderForm.jsx'
-
-import client from '../../../client.js'
-
-export default class Folders extends Component {
-  constructor(props) {
-    super()
-    this.state = {
-      adding: false,
-    }
-  }
-  openModal() {
-    this.setState({ adding: true })
-  }
-  closeModal() {
-    this.setState({ adding: false })
-  }
-  toggle(folder) {
-    folder.open = ! folder.open
-    if (folder.open && ! folder.files) {
-      client.file.index({ 'folder_id': folder.id }).then( files => {
-        console.log(files)
-        folder.files = files
-        this.props.openFolder(folder)
-      })
-    }
-  }
-  render() {
-    const folders = (this.props.folders || []).map( (folder,i) => {
-      return (
-        <div key={i} onClick={() => this.toggle(folder)}>
-          <span class='name'>{folder.name}</span>
-        </div>
-      )
-    })
-    return (
-      <div class='window'>
-        <div class='heading'>
-          <b>browser</b>
-          <div class='buttons'>
-            <button onClick={() => this.openModal()}>+ folder</button>
-          </div>
-        </div>
-        <div class='list'>
-          {folders}
-        </div>
-        <Modal visible={this.state.adding} onClose={() => this.closeModal()}>
-          <FolderForm addFolder={this.props.addFolder} onClose={() => this.closeModal()} />
-        </Modal>
-      </div>
-    )
-  }
-}
-- 
cgit v1.2.3-70-g09d2

