Skip to content

Commit

Permalink
add empty state background
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Nov 16, 2023
1 parent fa16347 commit 5a5be5e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/pages/home/report/AnimatedEmptyStateBackground.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import Animated, {SensorType, useAnimatedSensor, useAnimatedStyle, useSharedValue, withSpring} from 'react-native-reanimated';
import EmptyStateBackgroundImage from '@assets/images/empty-state_background-fade.png';
import useWindowDimensions from '@hooks/useWindowDimensions';
import * as NumberUtils from '@libs/NumberUtils';
import useThemeIllustrations from '@styles/illustrations/useThemeIllustrations';
import * as StyleUtils from '@styles/StyleUtils';
import variables from '@styles/variables';
import CONST from '@src/CONST';
Expand All @@ -11,6 +11,7 @@ const IMAGE_OFFSET_Y = 75;

function AnimatedEmptyStateBackground() {
const {windowWidth, isSmallScreenWidth} = useWindowDimensions();
const illustrations = useThemeIllustrations();
const IMAGE_OFFSET_X = windowWidth / 2;

// If window width is greater than the max background width, repeat the background image
Expand Down Expand Up @@ -41,7 +42,7 @@ function AnimatedEmptyStateBackground() {

return (
<Animated.Image
source={EmptyStateBackgroundImage}
source={illustrations.EmptyStateBackgroundImage}
style={[StyleUtils.getReportWelcomeBackgroundImageStyle(isSmallScreenWidth), animatedStyles]}
resizeMode={windowWidth > maxBackgroundWidth ? 'repeat' : 'cover'}
/>
Expand Down
2 changes: 2 additions & 0 deletions src/styles/illustrations/dark.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import EmptyStateBackgroundImage from '@assets/images/empty-state_background-fade-dark.png';
import Abracadabra from '@assets/images/product-illustrations/abracadabra.svg';
import BankArrowPink from '@assets/images/product-illustrations/bank-arrow--pink.svg';
import BankMouseGreen from '@assets/images/product-illustrations/bank-mouse--green.svg';
Expand Down Expand Up @@ -59,6 +60,7 @@ export {
ConciergeExclamation,
CreditCardsBlue,
EmailAddress,
EmptyStateBackgroundImage,
InvoiceOrange,
JewelBoxBlue,
JewelBoxGreen,
Expand Down
2 changes: 2 additions & 0 deletions src/styles/illustrations/light.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import EmptyStateBackgroundImage from '@assets/images/empty-state_background-fade-light.png';
import Abracadabra from '@assets/images/product-illustrations/abracadabra.svg';
import BankArrowPink from '@assets/images/product-illustrations/bank-arrow--pink.svg';
import BankMouseGreen from '@assets/images/product-illustrations/bank-mouse--green.svg';
Expand Down Expand Up @@ -59,6 +60,7 @@ export {
ConciergeExclamation,
CreditCardsBlue,
EmailAddress,
EmptyStateBackgroundImage,
InvoiceOrange,
JewelBoxBlue,
JewelBoxGreen,
Expand Down

0 comments on commit 5a5be5e

Please sign in to comment.