Skip to content

Commit

Permalink
Refactor remaining instances of WorkspacePageWithSections
Browse files Browse the repository at this point in the history
  • Loading branch information
amyevans committed May 25, 2022
1 parent 4a0bbeb commit 30e79ff
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class WorkspaceSettingsPage extends React.Component {
</FixedFooter>
)}
>
{hasVBA => (
{(isLoadingVBA, hasVBA) => (
<View style={[styles.pageWrapper, styles.flex1, styles.alignItemsStretch]}>
<AvatarWithImagePicker
isUploading={this.props.policy.isAvatarUploading}
Expand Down
7 changes: 4 additions & 3 deletions src/pages/workspace/bills/WorkspaceBillsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ const WorkspaceBillsPage = props => (
route={props.route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BILLS}
>
{(hasVBA, policyID) => (
{(isLoadingVBA, hasVBA, policyID) => (
<>
{!hasVBA ? (
{!isLoadingVBA && !hasVBA && (
<WorkspaceBillsNoVBAView policyID={policyID} />
) : (
)}
{!isLoadingVBA && hasVBA && (
<WorkspaceBillsVBAView policyID={policyID} />
)}
</>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/workspace/card/WorkspaceCardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ const WorkspaceCardPage = props => (
route={props.route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_CARD}
>
{(hasVBA, policyID, isUsingECard) => (
{(isLoadingVBA, hasVBA, policyID, isUsingECard) => (
<>
{!hasVBA && (
{!isLoadingVBA && !hasVBA && (
<WorkspaceCardNoVBAView policyID={policyID} />
)}

{hasVBA && !isUsingECard && (
{!isLoadingVBA && hasVBA && !isUsingECard && (
<WorkspaceCardVBANoECardView />
)}

{hasVBA && isUsingECard && (
{!isLoadingVBA && hasVBA && isUsingECard && (
<WorkspaceCardVBAWithECardView />
)}
</>
Expand Down
7 changes: 4 additions & 3 deletions src/pages/workspace/invoices/WorkspaceInvoicesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ const WorkspaceInvoicesPage = props => (
route={props.route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_INVOICES}
>
{(hasVBA, policyID) => (
{(isLoadingVBA, hasVBA, policyID) => (
<>
{!hasVBA ? (
{!isLoadingVBA && !hasVBA && (
<WorkspaceInvoicesNoVBAView policyID={policyID} />
) : (
)}
{!isLoadingVBA && hasVBA && (
<WorkspaceInvoicesVBAView policyID={policyID} />
)}
</>
Expand Down
7 changes: 4 additions & 3 deletions src/pages/workspace/travel/WorkspaceTravelPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ const WorkspaceTravelPage = props => (
route={props.route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_TRAVEL}
>
{(hasVBA, policyID) => (
{(isLoadingVBA, hasVBA, policyID) => (
<>
{!hasVBA ? (
{!isLoadingVBA && !hasVBA && (
<WorkspaceTravelNoVBAView policyID={policyID} />
) : (
)}
{!isLoadingVBA && hasVBA && (
<WorkspaceTravelVBAView />
)}
</>
Expand Down

0 comments on commit 30e79ff

Please sign in to comment.