Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson

const policyOwner = policy?.owner;
const currentUserLogin = currentUserPersonalDetails.login;
const invitedPrimaryToSecondaryLogins = invertObject(policy?.primaryLoginsInvited ?? {});
const invitedPrimaryToSecondaryLogins = useMemo(() => invertObject(policy?.primaryLoginsInvited ?? {}), [policy?.primaryLoginsInvited]);
const data: MemberOption[] = useMemo(() => {
const result: MemberOption[] = [];

Expand Down
35 changes: 16 additions & 19 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,24 +329,6 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
}, [setSelectedCategories, selectionMode?.isEnabled]);

const hasVisibleCategories = categoryList.some((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || isOffline);
const getHeaderText = () => (
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasSyncError && isConnectionVerified ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.categories.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`}
>
{`${currentConnectionName} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.categories.subtitle')}</Text>
)}
</View>
);

const threeDotsMenuItems = useMemo(() => {
const menuItems = [];
Expand Down Expand Up @@ -439,7 +421,22 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
danger
/>
{shouldUseNarrowLayout && <View style={[styles.pl5, styles.pr5]}>{getHeaderButtons()}</View>}
{hasVisibleCategories && !isLoading && getHeaderText()}
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasSyncError && isConnectionVerified ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.categories.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`}
>
{`${currentConnectionName} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.categories.subtitle')}</Text>
)}
</View>
{categoryList.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
label={translate('workspace.categories.findCategory')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {HandCard} from '@components/Icon/Illustrations';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {PressableWithFeedback} from '@components/Pressable';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import SearchBar from '@components/SearchBar';
import useBottomSafeSafeAreaPaddingStyle from '@hooks/useBottomSafeSafeAreaPaddingStyle';
import useExpensifyCardFeeds from '@hooks/useExpensifyCardFeeds';
Expand Down Expand Up @@ -178,7 +179,7 @@ function WorkspaceExpensifyCardListPage({route, cardsList, fundID}: WorkspaceExp
{isEmptyObject(cardsList) ? (
<EmptyCardView isBankAccountVerified={isBankAccountVerified} />
) : (
<>
<ScrollView>
<View style={styles.appBG}>
<WorkspaceCardListLabels
policyID={policyID}
Expand All @@ -200,7 +201,7 @@ function WorkspaceExpensifyCardListPage({route, cardsList, fundID}: WorkspaceExp
ListHeaderComponent={!isSearchEmpty ? renderListHeader : null}
contentContainerStyle={bottomSafeAreaPaddingStyle}
/>
</>
</ScrollView>
)}
<DelegateNoAccessModal
isNoDelegateAccessMenuVisible={isNoDelegateAccessMenuVisible}
Expand Down
26 changes: 11 additions & 15 deletions src/pages/workspace/perDiem/WorkspacePerDiemPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,6 @@ function WorkspacePerDiemPage({route}: WorkspacePerDiemPageProps) {

const hasVisibleSubRates = subRatesList.some((subRate) => subRate.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || isOffline);

const getHeaderText = () => (
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.perDiem.subtitle')}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
onPress={() => openExternalLink(CONST.DEEP_DIVE_PER_DIEM)}
>
{translate('workspace.common.learnMore')}
</TextLink>
</Text>
</View>
);

const threeDotsMenuItems = useMemo(() => {
const menuItems = [
{
Expand Down Expand Up @@ -420,7 +406,17 @@ function WorkspacePerDiemPage({route}: WorkspacePerDiemPageProps) {
danger
/>
{shouldUseNarrowLayout && <View style={[styles.pl5, styles.pr5]}>{getHeaderButtons()}</View>}
{(!hasVisibleSubRates || isLoading) && getHeaderText()}
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.perDiem.subtitle')}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
onPress={() => openExternalLink(CONST.DEEP_DIVE_PER_DIEM)}
>
{translate('workspace.common.learnMore')}
</TextLink>
</Text>
</View>
{subRatesList.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
label={translate('workspace.perDiem.findPerDiemRate')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function ReportFieldsListValuesPage({
<View style={[styles.ph5, styles.pv4]}>
<Text style={[styles.sidebarLinkText, styles.optionAlternateText]}>{translate('workspace.reportFields.listInputSubtitle')}</Text>
</View>
{filteredListValues.length > CONST.SEARCH_ITEM_LIMIT && (
{data.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
label={translate('workspace.reportFields.findReportField')}
inputValue={inputValue}
Expand Down
37 changes: 16 additions & 21 deletions src/pages/workspace/tags/WorkspaceTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,25 +420,6 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
return menuItems;
}, [policy, hasVisibleTags, translate, isOffline, isQuickSettingsFlow, policyID, backTo]);

const getHeaderText = () => (
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasSyncError && isConnectionVerified ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.tags.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyID)}`}
>
{`${currentConnectionName} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.tags.subtitle')}</Text>
)}
</View>
);

const selectionModeHeader = selectionMode?.isEnabled && shouldUseNarrowLayout;

return (
Expand Down Expand Up @@ -490,7 +471,22 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
cancelText={translate('common.cancel')}
danger
/>
{(!shouldUseNarrowLayout || !hasVisibleTags || isLoading) && getHeaderText()}
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasSyncError && isConnectionVerified ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.tags.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyID)}`}
>
{`${currentConnectionName} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.tags.subtitle')}</Text>
)}
</View>
{tagList.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
label={translate('workspace.tags.findTag')}
Expand Down Expand Up @@ -535,7 +531,6 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
shouldPreventDefaultFocusOnSelectRow={!canUseTouchScreen()}
listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]}
onDismissError={(item) => !isMultiLevelTags && clearPolicyTagErrors(policyID, item.value, 0)}
listHeaderContent={shouldUseNarrowLayout ? getHeaderText() : null}
showScrollIndicator={false}
addBottomSafeAreaPadding
/>
Expand Down
Loading