import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { enableSeadoc, gettext } from '../../utils/constants'; import Loading from '../loading'; import ModalPortal from '../modal-portal'; import CreateFile from '../../components/dialog/create-file-dialog'; import '../../css/tip-for-new-file.css'; const propTypes = { path: PropTypes.string.isRequired, isDirentListLoading: PropTypes.bool.isRequired, currentRepoInfo: PropTypes.object.isRequired, onAddFile: PropTypes.func.isRequired }; class DirentNodeView extends React.Component { constructor(props) { super(props); this.state = { fileType: '', isCreateFileDialogShow: false, }; } onCreateNewFile = (type) => { this.setState({ fileType: type, isCreateFileDialogShow: !this.state.isCreateFileDialogShow, }); }; onCreateFileToggle = () => { this.setState({ fileType: '', isCreateFileDialogShow: !this.state.isCreateFileDialogShow, }); }; checkDuplicatedName = () => { return false; // current repo is null, and unnecessary to check duplicated name }; render() { if (this.props.isDirentListLoading) { return (); } const { currentRepoInfo } = this.props; return (

{gettext('This folder has no content at this time.')}

{gettext('You can create files quickly')}{' +'}



{enableSeadoc && !currentRepoInfo.encrypted && }
{this.state.isCreateFileDialogShow && ( )}
); } } DirentNodeView.propTypes = propTypes; export default DirentNodeView;