Skip to content

Commit 4e57a59

Browse files
authored
Merge pull request Expensify#61996 from nabi-ebrahimi/fix/trips-empty-state-illustration-size
fix Lottie Animation Scaling and container width in Trips Empty State Illustration
2 parents 371b439 + dc70591 commit 4e57a59

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/pages/Search/EmptySearchView.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {useMemo, useRef, useState} from 'react';
22
// eslint-disable-next-line no-restricted-imports
3-
import type {GestureResponderEvent, Text as RNText} from 'react-native';
3+
import type {GestureResponderEvent, ImageStyle, Text as RNText, ViewStyle} from 'react-native';
44
import {Linking, View} from 'react-native';
55
import {useOnyx} from 'react-native-onyx';
66
import type {OnyxCollection} from 'react-native-onyx';
@@ -144,11 +144,11 @@ function EmptySearchView({type, hasResults}: EmptySearchViewProps) {
144144
case CONST.SEARCH.DATA_TYPES.TRIP:
145145
return {
146146
headerMedia: LottieAnimations.TripsEmptyState,
147-
headerContentStyles: [StyleUtils.getWidthAndHeightStyle(375, 240), StyleUtils.getBackgroundColorStyle(theme.travelBG)],
147+
headerContentStyles: [styles.emptyStateFolderWebStyles, StyleUtils.getBackgroundColorStyle(theme.travelBG)],
148148
title: translate('travel.title'),
149149
titleStyles: {...styles.textAlignLeft},
150150
children: tripViewChildren,
151-
lottieWebViewStyles: {backgroundColor: theme.travelBG, ...styles.emptyStateFolderWebStyles},
151+
lottieWebViewStyles: {backgroundColor: theme.travelBG, ...styles.emptyStateFolderWebStyles, ...styles.tripEmptyStateLottieWebView},
152152
};
153153
case CONST.SEARCH.DATA_TYPES.EXPENSE:
154154
if (!hasResults) {
@@ -247,6 +247,7 @@ function EmptySearchView({type, hasResults}: EmptySearchViewProps) {
247247
translate,
248248
styles.textAlignLeft,
249249
styles.emptyStateFolderWebStyles,
250+
styles.tripEmptyStateLottieWebView,
250251
tripViewChildren,
251252
hasSeenTour,
252253
navatticURL,
@@ -272,7 +273,7 @@ function EmptySearchView({type, hasResults}: EmptySearchViewProps) {
272273
titleStyles={content.titleStyles}
273274
subtitle={content.subtitle}
274275
buttons={content.buttons}
275-
headerContentStyles={[styles.h100, styles.w100, ...content.headerContentStyles]}
276+
headerContentStyles={[styles.h100, styles.w100, ...content.headerContentStyles] as Array<ViewStyle & ImageStyle>}
276277
lottieWebViewStyles={content.lottieWebViewStyles}
277278
>
278279
{content.children}

src/styles/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5601,6 +5601,11 @@ const styles = (theme: ThemeColors) =>
56015601
...display.dFlex,
56025602
},
56035603

5604+
tripEmptyStateLottieWebView: {
5605+
width: 335,
5606+
height: 220,
5607+
},
5608+
56045609
workflowApprovalVerticalLine: {
56055610
height: 16,
56065611
width: 1,

0 commit comments

Comments
 (0)