Skip to content

Commit 7b09007

Browse files
committed
chore: rebase with main
1 parent 83fd154 commit 7b09007

File tree

2 files changed

+23
-51
lines changed

2 files changed

+23
-51
lines changed

src/components/IllustratedHeaderPageLayout.js

+21-50
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
import _ from 'underscore';
21
import React from 'react';
32
import PropTypes from 'prop-types';
4-
import {ScrollView, View} from 'react-native';
5-
import Lottie from 'lottie-react-native';
3+
import Lottie from './Lottie';
64
import headerWithBackButtonPropTypes from './HeaderWithBackButton/headerWithBackButtonPropTypes';
7-
import HeaderWithBackButton from './HeaderWithBackButton';
8-
import ScreenWrapper from './ScreenWrapper';
95
import styles from '../styles/styles';
106
import themeColors from '../styles/themes/default';
11-
import * as StyleUtils from '../styles/StyleUtils';
12-
import useWindowDimensions from '../hooks/useWindowDimensions';
13-
import FixedFooter from './FixedFooter';
14-
import useNetwork from '../hooks/useNetwork';
7+
import HeaderPageLayout from './HeaderPageLayout';
158

169
const propTypes = {
1710
...headerWithBackButtonPropTypes,
@@ -30,59 +23,37 @@ const propTypes = {
3023

3124
/** Overlay content to display on top of animation */
3225
overlayContent: PropTypes.func,
33-
34-
/** Whether to include padding top */
35-
includePaddingTop: PropTypes.bool,
3626
};
3727

3828
const defaultProps = {
3929
backgroundColor: themeColors.appBG,
4030
footer: null,
4131
overlayContent: null,
42-
includePaddingTop: true,
4332
};
4433

45-
function IllustratedHeaderPageLayout({backgroundColor, children, illustration, footer, overlayContent, includePaddingTop, ...propsToPassToHeader}) {
46-
const {windowHeight} = useWindowDimensions();
47-
const {isOffline} = useNetwork();
34+
function IllustratedHeaderPageLayout({backgroundColor, children, illustration, footer, overlayContent, ...propsToPassToHeader}) {
4835
return (
49-
<ScreenWrapper
50-
style={[StyleUtils.getBackgroundColorStyle(backgroundColor)]}
51-
shouldEnablePickerAvoiding={false}
52-
includeSafeAreaPaddingBottom={false}
53-
includePaddingTop={includePaddingTop}
54-
offlineIndicatorStyle={[StyleUtils.getBackgroundColorStyle(themeColors.appBG)]}
55-
>
56-
{({safeAreaPaddingBottomStyle}) => (
36+
<HeaderPageLayout
37+
backgroundColor={backgroundColor}
38+
title={propsToPassToHeader.title}
39+
headerContent={
5740
<>
58-
<HeaderWithBackButton
59-
// eslint-disable-next-line react/jsx-props-no-spreading
60-
{...propsToPassToHeader}
61-
titleColor={backgroundColor === themeColors.appBG ? undefined : themeColors.textColorfulBackground}
62-
iconFill={backgroundColor === themeColors.appBG ? undefined : themeColors.iconColorfulBackground}
41+
<Lottie
42+
source={illustration}
43+
style={styles.w100}
44+
autoPlay
45+
loop
6346
/>
64-
<View style={[styles.flex1, StyleUtils.getBackgroundColorStyle(themeColors.appBG), !isOffline ? safeAreaPaddingBottomStyle : {}]}>
65-
<ScrollView
66-
contentContainerStyle={safeAreaPaddingBottomStyle}
67-
showsVerticalScrollIndicator={false}
68-
>
69-
<View style={styles.overscrollSpacer(backgroundColor, windowHeight)} />
70-
<View style={[styles.alignItemsCenter, styles.justifyContentEnd, StyleUtils.getBackgroundColorStyle(backgroundColor)]}>
71-
<Lottie
72-
source={illustration}
73-
style={styles.w100}
74-
autoPlay
75-
loop
76-
/>
77-
{overlayContent && overlayContent()}
78-
</View>
79-
<View style={[styles.pt5]}>{children}</View>
80-
</ScrollView>
81-
{!_.isNull(footer) && <FixedFooter>{footer}</FixedFooter>}
82-
</View>
47+
{overlayContent && overlayContent()}
8348
</>
84-
)}
85-
</ScreenWrapper>
49+
}
50+
headerContainerStyles={[styles.justifyContentCenter, styles.w100]}
51+
footer={footer}
52+
// eslint-disable-next-line react/jsx-props-no-spreading
53+
{...propsToPassToHeader}
54+
>
55+
{children}
56+
</HeaderPageLayout>
8657
);
8758
}
8859

src/components/LottieAnimations.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ const ReviewingBankInfo = require('../../assets/animations/ReviewingBankInfo.jso
77
const WorkspacePlanet = require('../../assets/animations/WorkspacePlanet.json');
88
const SaveTheWorld = require('../../assets/animations/SaveTheWorld.json');
99
const Safe = require('../../assets/animations/Safe.json');
10+
const Magician = require('../../assets/animations/Magician.json');
1011

11-
export {ExpensifyLounge, FastMoney, Fireworks, Hands, PreferencesDJ, ReviewingBankInfo, SaveTheWorld, WorkspacePlanet, Safe};
12+
export {ExpensifyLounge, FastMoney, Fireworks, Hands, PreferencesDJ, ReviewingBankInfo, SaveTheWorld, WorkspacePlanet, Safe, Magician};

0 commit comments

Comments
 (0)