Skip to content

Commit 05d0f31

Browse files
authored
Merge pull request #102083 from software-mansion-labs/insights/fix-empty-state-scroll
[Insights] fix: Insights empty state is not scrollable in landscape mode
2 parents 2859890 + 3e6d64d commit 05d0f31

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎src/pages/Insights/InsightsDashboard.tsx‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,15 @@ function InsightsDashboardContent({dashboardID, hash, state, filters, onRetry}:
8484
);
8585
}
8686

87-
if (state === INSIGHTS_DASHBOARD_STATE.NO_EXPENSES) {
88-
return <InsightsNoExpensesState />;
89-
}
90-
91-
if (state === INSIGHTS_DASHBOARD_STATE.EMPTY) {
92-
return <InsightsEmptyState />;
87+
if (state === INSIGHTS_DASHBOARD_STATE.NO_EXPENSES || state === INSIGHTS_DASHBOARD_STATE.EMPTY) {
88+
return (
89+
<ScrollView
90+
contentContainerStyle={[styles.flexGrow1, styles.flexShrink0]}
91+
addBottomSafeAreaPadding
92+
>
93+
{state === INSIGHTS_DASHBOARD_STATE.NO_EXPENSES ? <InsightsNoExpensesState /> : <InsightsEmptyState />}
94+
</ScrollView>
95+
);
9396
}
9497

9598
const {headlineChart, supportingCharts} = INSIGHTS_DASHBOARD_SPECS[dashboardID];

‎src/pages/Insights/states/InsightsEmptyState.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function InsightsEmptyState() {
1919
headerContentStyles={[styles.insightsEmptyStateIllustration]}
2020
title={translate('insightsPage.emptyState.title')}
2121
subtitle={translate('insightsPage.emptyState.subtitle')}
22+
minModalHeight={0}
2223
/>
2324
);
2425
}

‎src/pages/Insights/states/InsightsNoExpensesState.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function InsightsNoExpensesState() {
2424
headerContentStyles={[styles.insightsEmptyStateIllustration]}
2525
title={translate('insightsPage.noExpensesState.title')}
2626
subtitle={translate('insightsPage.noExpensesState.subtitle')}
27+
minModalHeight={0}
2728
buttons={[
2829
{
2930
buttonText: translate('iou.createExpense'),

0 commit comments

Comments
 (0)