joyent-portal/frontend/src/components/people-list/index.js

55 lines
1.1 KiB
JavaScript
Raw Normal View History

const React = require('react');
const Row = require('@ui/components/row');
const Column = require('@ui/components/column');
const Button = require('@ui/components/button');
const PeopleTable = require('./table');
2017-01-23 17:47:45 +02:00
const Invite = require('./invite');
const buttonStyle = {
float: 'right'
};
const People = (props) => {
const {
UI = {},
2017-01-23 17:47:45 +02:00
handleToggle,
people
} = props;
return (
<div>
<Row>
<Column smOffset={9} xs={2}>
<Button
disabled={UI.invite_toggled}
onClick={handleToggle}
style={buttonStyle}
>
Invite
</Button>
</Column>
</Row>
{UI.invite_toggled ? <Invite {...props} /> : null}
2017-01-23 17:47:45 +02:00
<Row>
<Column xs={12}>
{ people.length > 0
? <PeopleTable {...props} />
: <h3>There is nobody in this orgnaisation</h3> }
</Column>
</Row>
</div>
);
};
People.propTypes = {
UI: React.PropTypes.object,
handleToggle: React.PropTypes.func,
people: React.PropTypes.array,
};
module.exports = People;