Skip to content

Commit

Permalink
Merge pull request #43818 from Expensify/vit-43799
Browse files Browse the repository at this point in the history
[CP Staging] Remove withPolicyAndFullscreenLoading from WorkspacesListPage
  • Loading branch information
srikarparsi authored Jun 16, 2024
2 parents 35e9d37 + a602d37 commit df9689f
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions src/pages/workspace/WorkspacesListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import ROUTES from '@src/ROUTES';
import type {Policy as PolicyType, ReimbursementAccount, Report, Session as SessionType} from '@src/types/onyx';
import type * as OnyxCommon from '@src/types/onyx/OnyxCommon';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import withPolicyAndFullscreenLoading from './withPolicyAndFullscreenLoading';
import type {WithPolicyAndFullscreenLoadingProps} from './withPolicyAndFullscreenLoading';
import WorkspacesListRow from './WorkspacesListRow';

type WorkspaceItem = Required<Pick<MenuItemProps, 'title' | 'disabled'>> &
Expand Down Expand Up @@ -82,7 +80,7 @@ type WorkspaceListPageOnyxProps = {
session: OnyxEntry<SessionType>;
};

type WorkspaceListPageProps = WithPolicyAndFullscreenLoadingProps & WorkspaceListPageOnyxProps;
type WorkspaceListPageProps = WorkspaceListPageOnyxProps;

const workspaceFeatures: FeatureListItem[] = [
{
Expand Down Expand Up @@ -440,20 +438,18 @@ function WorkspacesListPage({policies, reimbursementAccount, reports, session}:

WorkspacesListPage.displayName = 'WorkspacesListPage';

export default withPolicyAndFullscreenLoading(
withOnyx<WorkspaceListPageProps, WorkspaceListPageOnyxProps>({
policies: {
key: ONYXKEYS.COLLECTION.POLICY,
},
// @ts-expect-error: ONYXKEYS.REIMBURSEMENT_ACCOUNT is conflicting with ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM
reimbursementAccount: {
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
},
reports: {
key: ONYXKEYS.COLLECTION.REPORT,
},
session: {
key: ONYXKEYS.SESSION,
},
})(WorkspacesListPage),
);
export default withOnyx<WorkspaceListPageProps, WorkspaceListPageOnyxProps>({
policies: {
key: ONYXKEYS.COLLECTION.POLICY,
},
// @ts-expect-error: ONYXKEYS.REIMBURSEMENT_ACCOUNT is conflicting with ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM
reimbursementAccount: {
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
},
reports: {
key: ONYXKEYS.COLLECTION.REPORT,
},
session: {
key: ONYXKEYS.SESSION,
},
})(WorkspacesListPage);

0 comments on commit df9689f

Please sign in to comment.