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
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {getEarliestErrorField, getLatestErrorField} from '@libs/ErrorUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {close} from '@userActions/Modal';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -234,8 +235,14 @@ function ContactMethodDetailsPage({route}: ContactMethodDetailsPageProps) {
return menuItems;
}, [isValidateCodeFormVisible, translate, turnOnDeleteModal, isDefaultContactMethod, icons.Trashcan]);

const reasonAttributes: SkeletonSpanReasonAttributes = {
context: 'ContactMethodDetailsPage',
isLoadingOnyxValues,
isLoadingReportData,
};

if (isLoadingOnyxValues || (isLoadingReportData && isEmptyObject(loginList))) {
return <FullscreenLoadingIndicator />;
return <FullscreenLoadingIndicator reasonAttributes={reasonAttributes} />;
}

if (!contactMethod || !loginData) {
Expand Down
11 changes: 9 additions & 2 deletions src/pages/settings/Profile/CustomStatus/SetDatePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import DateUtils from '@libs/DateUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {getDatePassedError, getFieldRequiredErrors} from '@libs/ValidationUtils';
import {updateStatusDraftCustomClearAfterDate} from '@userActions/User';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -46,8 +47,14 @@ function SetDatePage() {
[translate],
);

if (isLoadingOnyxValue(statusDraftCustomClearAfterDateMetaData)) {
return <FullScreenLoadingIndicator />;
const isLoadingStatusDraft = isLoadingOnyxValue(statusDraftCustomClearAfterDateMetaData);
const reasonAttributes: SkeletonSpanReasonAttributes = {
context: 'SetDatePage',
isLoadingStatusDraft,
};

if (isLoadingStatusDraft) {
return <FullScreenLoadingIndicator reasonAttributes={reasonAttributes} />;
}

return (
Expand Down
6 changes: 5 additions & 1 deletion src/pages/settings/Profile/DisplayNamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import {addErrorMessage} from '@libs/ErrorUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {doesContainReservedWord, isValidDisplayName} from '@libs/ValidationUtils';
import {updateDisplayName as updateDisplayNamePersonalDetails} from '@userActions/PersonalDetails';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -81,7 +82,10 @@ function DisplayNamePage({currentUserPersonalDetails}: DisplayNamePageProps) {
onBackButtonPress={() => Navigation.goBack()}
/>
{isLoadingApp ? (
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullScreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'DisplayNamePage', isLoadingApp} satisfies SkeletonSpanReasonAttributes}
/>
) : (
<FormProvider
style={[styles.flexGrow1, styles.ph5]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {doesContainReservedWord, isValidLegalName} from '@libs/ValidationUtils';
import CONST from '@src/CONST';
import type {OnyxFormKey} from '@src/ONYXKEYS';
Expand Down Expand Up @@ -108,7 +109,10 @@ function BaseLegalNamePage<TFormID extends OnyxFormKey>({
onBackButtonPress={onBackButtonPress ?? (() => Navigation.goBack())}
/>
{isLoadingApp ? (
<FullscreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullscreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'BaseLegalNamePage', isLoadingApp} satisfies SkeletonSpanReasonAttributes}
/>
) : (
<FormProvider
style={[styles.flexGrow1, styles.ph5]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {getAgeRequirementError, getFieldRequiredErrors} from '@libs/ValidationUtils';
import {updateDateOfBirth} from '@userActions/PersonalDetails';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -56,7 +57,10 @@ function DateOfBirthPage() {
onBackButtonPress={() => Navigation.goBack()}
/>
{isLoadingApp ? (
<FullscreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullscreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'DateOfBirthPage', isLoadingApp} satisfies SkeletonSpanReasonAttributes}
/>
) : (
<FormProvider
style={[styles.flexGrow1, styles.ph5]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import {normalizeCountryCode} from '@libs/CountryUtils';
import {getCurrentAddress} from '@libs/PersonalDetailsUtils';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import AddressPage from '@pages/AddressPage';
import type {FormOnyxValues} from '@src/components/Form/types';
import type {Country} from '@src/CONST';
Expand Down Expand Up @@ -35,8 +36,13 @@ function PersonalAddressPage() {
const [defaultCountry, defaultCountryStatus] = useOnyx(ONYXKEYS.COUNTRY);
const isLoading = isLoadingOnyxValue(defaultCountryStatus);
const address = useMemo(() => normalizeCountryCode(getCurrentAddress(privatePersonalDetails)) as Address, [privatePersonalDetails]);
const reasonAttributes: SkeletonSpanReasonAttributes = {
context: 'PersonalAddressPage',
isLoading,
};

if (isLoading) {
return <FullScreenLoadingIndicator />;
return <FullScreenLoadingIndicator reasonAttributes={reasonAttributes} />;
}
return (
<AddressPage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import {getEarliestErrorField} from '@libs/ErrorUtils';
import {appendCountryCode, formatE164PhoneNumber} from '@libs/LoginUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {isRequiredFulfilled, isValidPhoneNumber} from '@libs/ValidationUtils';
import {clearPhoneNumberError, updatePhoneNumber as updatePhone} from '@userActions/PersonalDetails';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -86,7 +87,10 @@ function PhoneNumberPage() {
onBackButtonPress={() => Navigation.goBack()}
/>
{isLoadingApp ? (
<FullscreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullscreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'PhoneNumberPage', isLoadingApp} satisfies SkeletonSpanReasonAttributes}
/>
) : (
<FormProvider
style={[styles.flexGrow1, styles.ph5]}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/settings/Profile/PronounsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {updatePronouns as updatePronounsPersonalDetails} from '@userActions/PersonalDetails';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -91,7 +92,7 @@ function PronounsPage({currentUserPersonalDetails}: PronounsPageProps) {
testID="PronounsPage"
>
{isLoadingApp && !currentUserPersonalDetails.pronouns ? (
<FullScreenLoadingIndicator />
<FullScreenLoadingIndicator reasonAttributes={{context: 'PronounsPage', isLoadingApp} satisfies SkeletonSpanReasonAttributes} />
) : (
<>
<HeaderWithBackButton
Expand Down
3 changes: 2 additions & 1 deletion src/pages/settings/Troubleshoot/TroubleshootPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {setShouldMaskOnyxState} from '@libs/actions/MaskOnyx';
import {openTroubleshootSettingsPage} from '@libs/actions/User';
import ExportOnyxState from '@libs/ExportOnyxState';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import colors from '@styles/theme/colors';
import {clearOnyxAndResetApp} from '@userActions/App';
import CONFIG from '@src/CONFIG';
Expand Down Expand Up @@ -196,7 +197,7 @@ function TroubleshootPage() {
icon={illustrations.Lightbulb}
shouldUseHeadlineHeader
/>
{isLoading && <FullScreenLoadingIndicator />}
{isLoading && <FullScreenLoadingIndicator reasonAttributes={{context: 'TroubleshootPage', isLoading} satisfies SkeletonSpanReasonAttributes} />}
<ScrollView contentContainerStyle={styles.pt3}>
<View style={[styles.flex1, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Section
Expand Down
6 changes: 5 additions & 1 deletion src/pages/settings/VerifyAccountPageBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import {clearContactMethodErrors, clearUnvalidatedNewContactMethodAction, requestValidateCodeAction, validateSecondaryLogin} from '@libs/actions/User';
import {getEarliestErrorField, getLatestErrorField} from '@libs/ErrorUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Route} from '@src/ROUTES';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
Expand Down Expand Up @@ -81,7 +82,10 @@ function VerifyAccountPageBase({navigateBackTo, navigateForwardTo, handleClose,
title={translate('contacts.validateAccount')}
onBackButtonPress={handleCloseWithFallback}
/>
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullScreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'VerifyAccountPageBase', isUserValidated} satisfies SkeletonSpanReasonAttributes}
/>
</ScreenWrapper>
);
}
Expand Down
Loading