diff --git a/src/pages/workspace/WorkspaceInitialPage.js b/src/pages/workspace/WorkspaceInitialPage.js index eb0c60ab9703..a4b086c31962 100644 --- a/src/pages/workspace/WorkspaceInitialPage.js +++ b/src/pages/workspace/WorkspaceInitialPage.js @@ -18,7 +18,7 @@ import themedefault from '../../styles/themes/default'; import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; import compose from '../../libs/compose'; import Avatar from '../../components/Avatar'; -import FullScreenLoadingIndicator from '../../components/FullscreenLoadingIndicator'; +import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView'; import withFullPolicy, {fullPolicyPropTypes, fullPolicyDefaultProps} from './withFullPolicy'; import * as PolicyActions from '../../libs/actions/Policy'; import CONST from '../../CONST'; @@ -76,10 +76,6 @@ class WorkspaceInitialPage extends React.Component { render() { const policy = this.props.policy; - if (_.isEmpty(policy)) { - return ; - } - const hasMembersError = PolicyActions.hasPolicyMemberError(this.props.policyMemberList); const menuItems = [ { @@ -127,108 +123,110 @@ class WorkspaceInitialPage extends React.Component { return ( - Navigation.navigate(ROUTES.SETTINGS)} - onCloseButtonPress={() => Navigation.dismissModal()} - shouldShowThreeDotsButton - shouldShowGetAssistanceButton - guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_INITIAL} - threeDotsMenuItems={[ - { - icon: Expensicons.Plus, - text: this.props.translate('workspace.new.newWorkspace'), - onSelected: () => PolicyActions.createAndNavigate(), - }, { - icon: Expensicons.Trashcan, - text: this.props.translate('workspace.common.delete'), - onSelected: () => this.setState({isDeleteModalOpen: true}), - }, - ]} - threeDotsAnchorPosition={styles.threeDotsPopoverOffset} - /> - - - - - - {this.props.policy.avatarURL - ? ( - - ) - : ( - - )} - - {!_.isEmpty(this.props.policy.name) && ( + + Navigation.navigate(ROUTES.SETTINGS)} + onCloseButtonPress={() => Navigation.dismissModal()} + shouldShowThreeDotsButton + shouldShowGetAssistanceButton + guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_INITIAL} + threeDotsMenuItems={[ + { + icon: Expensicons.Plus, + text: this.props.translate('workspace.new.newWorkspace'), + onSelected: () => PolicyActions.createAndNavigate(), + }, { + icon: Expensicons.Trashcan, + text: this.props.translate('workspace.common.delete'), + onSelected: () => this.setState({isDeleteModalOpen: true}), + }, + ]} + threeDotsAnchorPosition={styles.threeDotsPopoverOffset} + /> + + + + - - - {this.props.policy.name} - - + {this.props.policy.avatarURL + ? ( + + ) + : ( + + )} - )} + {!_.isEmpty(this.props.policy.name) && ( + + + + {this.props.policy.name} + + + + )} + + {_.map(menuItems, item => ( + item.action()} + shouldShowRightIcon + brickRoadIndicator={item.error ? 'error' : null} + /> + ))} - {_.map(menuItems, item => ( - item.action()} - shouldShowRightIcon - brickRoadIndicator={item.error ? 'error' : null} - /> - ))} - - - this.toggleDeleteModal(false)} - prompt={this.props.translate('workspace.common.deleteConfirmation')} - confirmText={this.props.translate('common.delete')} - cancelText={this.props.translate('common.cancel')} - danger - /> + + this.toggleDeleteModal(false)} + prompt={this.props.translate('workspace.common.deleteConfirmation')} + confirmText={this.props.translate('common.delete')} + cancelText={this.props.translate('common.cancel')} + danger + /> + ); }