adding data table to frontend roles component

This commit is contained in:
Alex Windett 2017-01-20 15:21:38 +00:00
parent fc9d940986
commit 5b390fdf65
4 changed files with 1204 additions and 1116 deletions

View File

@ -1,31 +0,0 @@
const React = require('react');
const PropTypes = require('@root/prop-types');
// const List = require('@ui/components/list');
// const {
// ListItem,
// ListItemView,
// ListItemMeta,
// ListItemTitle,
// ListItemOptions
// } = List;
const PersonItem = ({
person = {},
}) => {
return (
<tr>
<td>{person.uuid}</td>
<td>{person.uuid}</td>
<td>{person.uuid}</td>
</tr>
);
};
PersonItem.propTypes = {
person: PropTypes.person,
};
module.exports = PersonItem;

View File

@ -1,34 +1,36 @@
const React = require('react'); const React = require('react');
const PersonItem = require('@components/people-item');
const PropTypes = require('@root/prop-types'); const PropTypes = require('@root/prop-types');
const Table = require('@ui/components/table-data-table');
const PeopleList = ({ const PeopleList = ({
people = [] people = []
}) => { }) => {
const columns = [{
title: 'Memeber',
}, {
title: 'Status',
}, {
title: 'Role',
}, {
title: '', // Empty title for delete
}];
const peopleList = people.map((person) => ( const data = [];
<PersonItem
key={person.uuid} people.forEach( (person) => {
person={person} data.push({
/> name: person.uuid,
)); status: person.uuid,
role: person.uuid,
});
});
return ( return (
<div> <Table
<table> columns={columns}
<thead> data={data}
<tr> />
<th>Member</th>
<th>Status</th>
<th>Role</th>
</tr>
</thead>
<tbody>
{peopleList}
</tbody>
</table>
</div>
); );
}; };

View File

@ -43,7 +43,7 @@ const People = (props) => {
</Row> </Row>
<Row> <Row>
<Column> <Column xs={12}>
<PeopleList <PeopleList
people={people} people={people}
/> />

File diff suppressed because it is too large Load Diff