import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { Modal, ModalHeader, ModalBody, TabContent, TabPane, Nav, NavItem, NavLink } from 'reactstrap'; import { gettext } from '../../utils/constants'; import ShareToUser from './share-to-user'; import ShareToGroup from './share-to-group'; import GenerateShareLink from './generate-share-link'; import GenerateUploadLink from './generate-upload-link'; import '../../css/share-link-dialog.css'; const propTypes = { itemType: PropTypes.bool.isRequired, // there will be three choose: ['library', 'dir', 'file'] itemName: PropTypes.string.isRequired, itemPath: PropTypes.string.isRequired, toggleDialog: PropTypes.func.isRequired, repoID: PropTypes.string.isRequired }; class ShareDialog extends React.Component { constructor(props) { super(props); this.state = { activeTab: 'shareLink' }; } toggle = (tab) => { if (this.state.activeTab !== tab) { this.setState({activeTab: tab}); } } renderDirContent = () => { let activeTab = this.state.activeTab; return (
); } renderFileContent = () => { return (
); } render() { let { itemType, itemName } = this.props; return (
{gettext('Share')} {itemName} {(itemType === 'library' || itemType === 'dir') && this.renderDirContent()} {itemType === 'file' && this.renderFileContent()}
); } } ShareDialog.propTypes = propTypes; export default ShareDialog;