1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-26 18:51:03 +00:00
seahub/frontend/src/components/wiki-dir-list-view/wiki-dir-list-view.js

49 lines
1.4 KiB
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../utils/constants';
import { Utils } from '../../utils/utils';
2019-01-28 08:48:03 +00:00
import WikiDirListItem from './wiki-dir-list-item';
const propTypes = {
2019-01-28 08:48:03 +00:00
path: PropTypes.string.isRequired,
direntList: PropTypes.array.isRequired,
onDirentClick: PropTypes.func.isRequired,
2018-10-16 10:19:51 +00:00
};
2018-09-04 09:16:50 +00:00
2019-01-28 08:48:03 +00:00
class WikiDirListView extends React.Component {
2018-09-29 07:47:53 +00:00
2018-09-04 09:16:50 +00:00
render() {
const isDesktop = Utils.isDesktop();
2018-09-04 09:16:50 +00:00
return (
2024-07-18 03:58:42 +00:00
<table className={`table-hover ${isDesktop ? '' : 'table-thead-hidden'}`}>
2018-11-22 03:05:47 +00:00
<thead>
{isDesktop ? (
<tr>
2024-07-18 03:58:42 +00:00
<th style={{ width: '4%' }}></th>
<th style={{ width: '66%' }}>{gettext('Name')}</th>
<th style={{ width: '15%' }}>{gettext('Size')}</th>
<th style={{ width: '15%' }}>{gettext('Last Update')}</th>
</tr>
) : (
<tr>
<th width="12%"></th>
<th width="88%"></th>
</tr>
)}
2018-11-22 03:05:47 +00:00
</thead>
<tbody>
2019-01-28 08:48:03 +00:00
{this.props.direntList.length !== 0 && this.props.direntList.map((dirent, index) => {
2018-11-22 03:05:47 +00:00
return (
2019-01-28 08:48:03 +00:00
<WikiDirListItem key={index} path={this.props.path} dirent={dirent} onDirentClick={this.props.onDirentClick}/>
2018-11-22 03:05:47 +00:00
);
})}
</tbody>
</table>
);
2018-09-04 09:16:50 +00:00
}
}
2019-01-28 08:48:03 +00:00
WikiDirListView.propTypes = propTypes;
2019-01-28 08:48:03 +00:00
export default WikiDirListView;