p5.js-web-editor/client/components/mobile/Explorer.jsx

25 lines
638 B
React
Raw Normal View History

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