2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
2018-03-26 23:32:43 +02:00
|
|
|
import BusyIndicator from 'component/common/busy-indicator';
|
2017-12-21 22:08:54 +01:00
|
|
|
import InviteNew from 'component/inviteNew';
|
|
|
|
import InviteList from 'component/inviteList';
|
2018-03-26 23:32:43 +02:00
|
|
|
import Page from 'component/page';
|
2017-08-18 05:31:44 +02:00
|
|
|
|
|
|
|
class InvitePage extends React.PureComponent {
|
|
|
|
componentWillMount() {
|
|
|
|
this.props.fetchInviteStatus();
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { isPending, isFailed } = this.props;
|
|
|
|
|
|
|
|
return (
|
2018-03-26 23:32:43 +02:00
|
|
|
<Page>
|
|
|
|
{isPending && <BusyIndicator message={__('Checking your invite status')} />}
|
2017-08-18 05:31:44 +02:00
|
|
|
{!isPending &&
|
2017-12-21 22:08:54 +01:00
|
|
|
isFailed && <span className="empty">{__('Failed to retrieve invite status.')}</span>}
|
2018-03-26 23:32:43 +02:00
|
|
|
{!isPending &&
|
|
|
|
!isFailed && (
|
|
|
|
<React.Fragment>
|
|
|
|
<InviteNew />
|
|
|
|
<InviteList />
|
|
|
|
</React.Fragment>
|
|
|
|
)}
|
|
|
|
</Page>
|
2017-08-18 05:31:44 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default InvitePage;
|