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 (
{gettext("Library Type")} |
{gettext("Name")}
{/*TODO: sort*/}
|
{gettext("Actions")} |
{gettext("Size")} |
{gettext("Last Update")}
{/*TODO: sort*/}
|
{gettext("Owner")} |
{this.props.repoList.map(repo => {
return (
);
})}
);
}
renderMobileUI = () => {
return (
{gettext("Library Type")} |
{gettext("Sort:")} {/* TODO: sort */}
{gettext("name")}
{gettext("last update")}
|
{gettext("Actions")} |
{this.props.repoList.map(repo => {
return (
);
})}
);
}
render() {
if (window.innerWidth >= 768) {
return this.renderPCUI();
} else {
return this.renderMobileUI();
}
}
}
RepoListView.propTypes = propTypes;
export default RepoListView;