import React from 'react'; import PropTypes from 'prop-types'; import { gettext } from '../../utils/constants'; import RepoListItem from './repo-list-item'; const propTypes = { isShowRepoOwner: PropTypes.bool.isRequired, repoList: PropTypes.array.isRequired, }; class RepoListView extends React.Component { constructor(props) { super(props); this.state = { isItemFreezed: false, }; } renderPCUI = () => { return ( {this.props.repoList.map(repo => { return ( ); })}
{gettext("Library Type")} {gettext("Name")} {/*TODO: sort*/} {gettext("Actions")} {gettext("Size")} {gettext("Last Update")} {/*TODO: sort*/} {gettext("Owner")}
); } renderMobileUI = () => { return ( {this.props.repoList.map(repo => { return ( ); })}
{gettext("Library Type")} {gettext("Sort:")} {/* TODO: sort */} {gettext("name")} {gettext("last update")} {gettext("Actions")}
); } render() { if (window.innerWidth >= 768) { return this.renderPCUI(); } else { return this.renderMobileUI(); } } } RepoListView.propTypes = propTypes; export default RepoListView;