Skip to content

Commit

Permalink
use const
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Mar 1, 2024
1 parent 2ee1dfe commit 54943cb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ function WorkspaceCategoriesPage({policyCategories, route}: WorkspaceCategoriesP
Navigation.navigate(ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(route.params.policyID, category.text));
};

const isLoading = !isOffline && policyCategories === undefined;

const settingsButton = (
<View style={[styles.w100, styles.flexRow, isSmallScreenWidth && styles.mb3]}>
<Button
Expand Down Expand Up @@ -143,21 +145,21 @@ function WorkspaceCategoriesPage({policyCategories, route}: WorkspaceCategoriesP
<View style={[styles.ph5, styles.pb5]}>
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.categories.subtitle')}</Text>
</View>
{!isOffline && policyCategories === undefined && (
{categoryList.length === 0 && isLoading && (
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
style={[styles.flex1]}
color={theme.textSupporting}
color={theme.spinner}
/>
)}
{(isOffline || Boolean(policyCategories)) && categoryList.length === 0 && (
{categoryList.length === 0 && !isLoading && (
<WorkspaceEmptyStateSection
title={translate('workspace.categories.emptyCategories.title')}
icon={Illustrations.EmptyStateExpenses}
subtitle={translate('workspace.categories.emptyCategories.subtitle')}
/>
)}
{(isOffline || Boolean(policyCategories)) && Boolean(categoryList.length) && (
{categoryList.length > 0 && !isLoading && (
<SelectionList
canSelectMultiple
sections={[{data: categoryList, indexOffset: 0, isDisabled: false}]}
Expand Down

0 comments on commit 54943cb

Please sign in to comment.