import React from 'react'; import PropTypes from 'prop-types'; import ModalPortal from './modal-portal'; import { Modal } from 'reactstrap'; import ListTaggedFilesDialog from './dialog/list-taggedfiles-dialog'; import { siteRoot } from '../utils/constants'; import { Utils } from '../utils/utils'; import '../css/repo-info-bar.css'; const propTypes = { repoID: PropTypes.string.isRequired, currentPath: PropTypes.string.isRequired, usedRepoTags: PropTypes.array.isRequired, readmeMarkdown: PropTypes.object, }; class RepoInfoBar extends React.Component { constructor(props) { super(props); this.state = { currentTag: null, isListTaggedFileShow: false, }; } onListTaggedFiles = (currentTag) => { this.setState({ currentTag: currentTag, isListTaggedFileShow: !this.state.isListTaggedFileShow, }); } onCloseDialog = () => { this.setState({ isListTaggedFileShow: false }); } render() { let {repoID, currentPath, usedRepoTags, readmeMarkdown} = this.props; let href = readmeMarkdown !== null ? siteRoot + 'lib/' + repoID + '/file' + Utils.joinPath(currentPath, readmeMarkdown.name) : ''; return (