2017-01-18 19:00:59 +02:00
|
|
|
const React = require('react');
|
|
|
|
|
2017-01-23 16:00:10 +02:00
|
|
|
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');
|
2017-01-23 16:00:10 +02:00
|
|
|
|
|
|
|
const buttonStyle = {
|
|
|
|
float: 'right'
|
|
|
|
};
|
|
|
|
|
|
|
|
const People = (props) => {
|
|
|
|
|
|
|
|
const {
|
2017-01-26 16:34:06 +02:00
|
|
|
UI = {},
|
2017-01-23 17:47:45 +02:00
|
|
|
handleToggle,
|
2017-01-25 16:11:31 +02:00
|
|
|
people
|
2017-01-23 16:00:10 +02:00
|
|
|
} = props;
|
2017-01-18 19:00:59 +02:00
|
|
|
|
|
|
|
return (
|
2017-01-23 16:00:10 +02:00
|
|
|
<div>
|
|
|
|
<Row>
|
|
|
|
<Column smOffset={9} xs={2}>
|
|
|
|
<Button
|
2017-01-26 16:34:06 +02:00
|
|
|
disabled={UI.invite_toggled}
|
2017-01-23 16:00:10 +02:00
|
|
|
onClick={handleToggle}
|
|
|
|
style={buttonStyle}
|
|
|
|
>
|
|
|
|
Invite
|
|
|
|
</Button>
|
|
|
|
</Column>
|
|
|
|
</Row>
|
|
|
|
|
2017-01-26 16:34:06 +02:00
|
|
|
{UI.invite_toggled ? <Invite {...props} /> : null}
|
2017-01-23 17:47:45 +02:00
|
|
|
|
2017-01-23 16:00:10 +02:00
|
|
|
<Row>
|
|
|
|
<Column xs={12}>
|
2017-01-25 16:11:31 +02:00
|
|
|
{ people.length > 0
|
|
|
|
? <PeopleTable {...props} />
|
|
|
|
: <h3>There is nobody in this orgnaisation</h3> }
|
2017-01-23 16:00:10 +02:00
|
|
|
</Column>
|
|
|
|
</Row>
|
|
|
|
</div>
|
2017-01-18 19:00:59 +02:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2017-01-23 16:00:10 +02:00
|
|
|
People.propTypes = {
|
2017-01-26 16:34:06 +02:00
|
|
|
UI: React.PropTypes.object,
|
2017-01-23 16:00:10 +02:00
|
|
|
handleToggle: React.PropTypes.func,
|
2017-01-26 16:34:06 +02:00
|
|
|
people: React.PropTypes.array,
|
2017-01-18 19:00:59 +02:00
|
|
|
};
|
|
|
|
|
2017-01-23 16:00:10 +02:00
|
|
|
module.exports = People;
|