Skip to content
Merged
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
97 changes: 53 additions & 44 deletions src/pages/settings/Troubleshoot/TroubleshootPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import ActivityIndicator from '@components/ActivityIndicator';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ImportOnyxState from '@components/ImportOnyxState';
import MenuItemList from '@components/MenuItemList';
Expand Down Expand Up @@ -49,7 +49,7 @@ import type WithSentryLabel from '@src/types/utils/SentryLabel';

import {differenceInDays} from 'date-fns';
import React, {useCallback, useEffect, useState} from 'react';
import {View} from 'react-native';
import {StyleSheet, View} from 'react-native';

import useTroubleshootSectionIllustration from './useTroubleshootSectionIllustration';

Expand Down Expand Up @@ -207,49 +207,58 @@ function TroubleshootPage() {
icon={illustrations.Lightbulb}
shouldUseHeadlineHeader
/>
{isLoading && <FullScreenLoadingIndicator reasonAttributes={{context: 'TroubleshootPage', isLoading} satisfies SkeletonSpanReasonAttributes} />}
<ScrollView contentContainerStyle={styles.pt3}>
<View style={[styles.flex1, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Section
title={translate('initialSettingsPage.aboutPage.troubleshoot')}
subtitle={translate('initialSettingsPage.troubleshoot.description')}
isCentralPane
subtitleMuted
illustrationContainerStyle={styles.cardSectionIllustrationContainer}
illustrationBackgroundColor={colors.blue700}
titleStyles={styles.accountSettingsSectionTitle}
renderSubtitle={() => <SectionSubtitleHTML html={translate('initialSettingsPage.troubleshoot.description')} />}
{...troubleshootIllustration}
>
<View style={[styles.flex1, styles.mt5]}>
<View>
<TestToolRow title={translate('initialSettingsPage.troubleshoot.maskExportOnyxStateData')}>
<Switch
accessibilityLabel={translate('initialSettingsPage.troubleshoot.maskExportOnyxStateData')}
isOn={shouldMaskOnyxState}
onToggle={setShouldMaskOnyxState}
/>
</TestToolRow>
</View>
<ImportOnyxState setIsLoading={setIsLoading} />
<MenuItemList
menuItems={menuItems}
shouldUseSingleExecution
/>
{!isProduction && (
<View style={[styles.mt6]}>
<TestToolMenu />
</View>
)}
{isDevelopment && (
<View style={[styles.mt6]}>
<SentryDebugToolMenu />
<View style={styles.flex1}>
<ScrollView contentContainerStyle={styles.pt3}>
<View style={[styles.flex1, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Section
title={translate('initialSettingsPage.aboutPage.troubleshoot')}
subtitle={translate('initialSettingsPage.troubleshoot.description')}
isCentralPane
subtitleMuted
illustrationContainerStyle={styles.cardSectionIllustrationContainer}
illustrationBackgroundColor={colors.blue700}
titleStyles={styles.accountSettingsSectionTitle}
renderSubtitle={() => <SectionSubtitleHTML html={translate('initialSettingsPage.troubleshoot.description')} />}
{...troubleshootIllustration}
>
<View style={[styles.flex1, styles.mt5]}>
<View>
<TestToolRow title={translate('initialSettingsPage.troubleshoot.maskExportOnyxStateData')}>
<Switch
accessibilityLabel={translate('initialSettingsPage.troubleshoot.maskExportOnyxStateData')}
isOn={shouldMaskOnyxState}
onToggle={setShouldMaskOnyxState}
/>
</TestToolRow>
</View>
)}
</View>
</Section>
</View>
</ScrollView>
<ImportOnyxState setIsLoading={setIsLoading} />
<MenuItemList
menuItems={menuItems}
shouldUseSingleExecution
/>
{!isProduction && (
<View style={[styles.mt6]}>
<TestToolMenu />
</View>
)}
{isDevelopment && (
<View style={[styles.mt6]}>
<SentryDebugToolMenu />
</View>
)}
</View>
</Section>
</View>
</ScrollView>
{isLoading && (
<View style={[StyleSheet.absoluteFill, styles.fullScreenLoading]}>
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
reasonAttributes={{context: 'TroubleshootPage', isLoading} satisfies SkeletonSpanReasonAttributes}
/>
</View>
)}
</View>
</ScreenWrapper>
);
}
Expand Down
Loading