// @flow import { SITE_NAME } from 'config'; import React from 'react'; import BusyIndicator from 'component/common/busy-indicator'; import InviteNew from 'component/inviteNew'; import InviteList from 'component/inviteList'; import Page from 'component/page'; import RewardAuthIntro from 'component/rewardAuthIntro'; type Props = { isPending: boolean, isFailed: boolean, inviteAcknowledged: boolean, authenticated: boolean, acknowledgeInivte: () => void, fetchInviteStatus: () => void, }; class InvitePage extends React.PureComponent { componentDidMount() { const { fetchInviteStatus, inviteAcknowledged, acknowledgeInivte } = this.props; fetchInviteStatus(); if (!inviteAcknowledged) { acknowledgeInivte(); } } render() { const { isPending, isFailed, authenticated } = this.props; return ( {!authenticated ? ( ) : ( {isPending && } {!isPending && isFailed && {__('Failed to retrieve invite status.')}} {!isPending && !isFailed && ( {' '} )} )} ); } } export default InvitePage;