2020-08-07 19:09:17 +02:00
|
|
|
import React from 'react';
|
|
|
|
import styled from 'styled-components';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Sidebar from './Sidebar';
|
|
|
|
import ConnectedFileNode from '../../modules/IDE/components/FileNode';
|
|
|
|
|
|
|
|
|
2020-08-07 23:32:50 +02:00
|
|
|
const Explorer = ({ id, canEdit, onPressClose }) => (
|
|
|
|
<Sidebar title="Files" onPressClose={onPressClose}>
|
2020-08-07 23:48:39 +02:00
|
|
|
<ConnectedFileNode id={id} canEdit={canEdit} onClickFile={() => onPressClose()} />
|
2020-08-07 19:09:17 +02:00
|
|
|
</Sidebar>
|
|
|
|
);
|
|
|
|
|
|
|
|
Explorer.propTypes = {
|
|
|
|
id: PropTypes.number.isRequired,
|
2020-08-07 23:32:50 +02:00
|
|
|
onPressClose: PropTypes.func,
|
2020-08-07 19:09:17 +02:00
|
|
|
canEdit: PropTypes.bool
|
|
|
|
};
|
|
|
|
Explorer.defaultProps = {
|
2020-08-07 23:32:50 +02:00
|
|
|
canEdit: false,
|
|
|
|
onPressClose: () => {}
|
2020-08-07 19:09:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default Explorer;
|