import React from 'react'; import PropTypes from 'prop-types'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import { DropTarget } from 'react-dnd'; import Path from 'path'; import "./filesystem.scss"; import { Container, NgIf } from '../../components/'; import { NewThing } from './thing-new'; import { ExistingThing } from './thing-existing'; import { FileZone } from './filezone'; @DropTarget('__NATIVE_FILE__', {}, (connect, monitor) => ({ connectDropFile: connect.dropTarget(), fileIsOver: monitor.isOver() })) export class FileSystem extends React.Component { constructor(props){ super(props); this.state = { creating: null, access_right: this._findAccessRight(props.files) }; } _findAccessRight(files){ for(let i=0, l=files.length; i< l; i++){ let file = files[i]; if(file.name === './' && file.type === 'metadata'){ return file; } } return {can_create_file: true, can_create_directory: true}; } onComponentPropsUpdate(props){ this.setState({access_right: this._findAccessRight(props.files)}); } render() { return this.props.connectDropFile(
this.props.onView(value)} onSortUpdate={(value) => {this.props.onSort(value);}} accessRight={this.state.access_right}> 0}> { this.props.files.map((file, index) => { if(file.type === 'directory' || file.type === 'file' || file.type === 'link' || file.type === 'bucket'){ return ( ); } }) } There is nothing here
); } } FileSystem.PropTypes = { path: PropTypes.string.isRequired, files: PropTypes.array.isRequired }