From f3faf1893c922437f14e6e323840b3a143343723 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 28 Feb 2024 16:04:04 -0700 Subject: [PATCH] use ActivityIndicator --- src/libs/actions/Policy.ts | 2 +- .../categories/WorkspaceCategoriesPage.tsx | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts index f37247496626..96ecfa63a634 100644 --- a/src/libs/actions/Policy.ts +++ b/src/libs/actions/Policy.ts @@ -16,9 +16,9 @@ import type { DeleteWorkspaceAvatarParams, DeleteWorkspaceParams, OpenDraftWorkspaceRequestParams, + OpenPolicyCategoriesPageParams, OpenWorkspaceInvitePageParams, OpenWorkspaceMembersPageParams, - OpenPolicyCategoriesPageParams, OpenWorkspaceParams, OpenWorkspaceReimburseViewParams, SetWorkspaceApprovalModeParams, diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 90aab254d3a1..4b73b75d62e4 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -1,6 +1,6 @@ import type {StackScreenProps} from '@react-navigation/stack'; -import React, {useMemo, useState, useEffect} from 'react'; -import {View} from 'react-native'; +import React, {useEffect, useMemo, useState} from 'react'; +import {ActivityIndicator, View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import type {OnyxEntry} from 'react-native-onyx'; import Button from '@components/Button'; @@ -21,12 +21,12 @@ import Navigation from '@libs/Navigation/Navigation'; import type {CentralPaneNavigatorParamList} from '@navigation/types'; import AdminPolicyAccessOrNotFoundWrapper from '@pages/workspace/AdminPolicyAccessOrNotFoundWrapper'; import PaidPolicyAccessOrNotFoundWrapper from '@pages/workspace/PaidPolicyAccessOrNotFoundWrapper'; +import * as Policy from '@userActions/Policy'; +import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; import type * as OnyxTypes from '@src/types/onyx'; -import * as Policy from '@userActions/Policy'; -import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; type PolicyForList = { value: string; @@ -112,10 +112,6 @@ function WorkspaceCategoriesPage({policyCategories, route}: WorkspaceCategoriesP ); - if (policyCategories === undefined) { - return ; - } - return ( @@ -136,7 +132,13 @@ function WorkspaceCategoriesPage({policyCategories, route}: WorkspaceCategoriesP {translate('workspace.categories.subtitle')} - {categoryList.length ? ( + {policyCategories === undefined ? ( + + ) : categoryList.length ? (