2020-08-07 17:09:17 +00: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 21:32:50 +00:00
|
|
|
const Explorer = ({ id, canEdit, onPressClose }) => (
|
|
|
|
<Sidebar title="Files" onPressClose={onPressClose}>
|
2020-08-07 21:48:39 +00:00
|
|
|
<ConnectedFileNode id={id} canEdit={canEdit} onClickFile={() => onPressClose()} />
|
2020-08-07 17:09:17 +00:00
|
|
|
</Sidebar>
|
|
|
|
);
|
|
|
|
|
|
|
|
Explorer.propTypes = {
|
|
|
|
id: PropTypes.number.isRequired,
|
2020-08-07 21:32:50 +00:00
|
|
|
onPressClose: PropTypes.func,
|
2020-08-07 17:09:17 +00:00
|
|
|
canEdit: PropTypes.bool
|
|
|
|
};
|
|
|
|
Explorer.defaultProps = {
|
2020-08-07 21:32:50 +00:00
|
|
|
canEdit: false,
|
|
|
|
onPressClose: () => {}
|
2020-08-07 17:09:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default Explorer;
|