11import React from 'react' ;
2- import type { TextStyle , ViewStyle } from 'react-native' ;
3- import { View } from 'react-native' ;
2+ import type { StyleProp , TextStyle , ViewStyle } from 'react-native' ;
3+ import { StyleSheet , View } from 'react-native' ;
44import useThemeStyles from '@hooks/useThemeStyles' ;
55import isIllustrationLottieAnimation from '@libs/isIllustrationLottieAnimation' ;
66import type IconAsset from '@src/types/utils/IconAsset' ;
@@ -47,10 +47,10 @@ type ConfirmationPageProps = {
4747 headingStyle ?: TextStyle ;
4848
4949 /** Additional style for the animation */
50- illustrationStyle ?: ViewStyle ;
50+ illustrationStyle ?: StyleProp < ViewStyle > ;
5151
5252 /** Additional style for the description */
53- descriptionStyle ?: TextStyle ;
53+ descriptionStyle ?: StyleProp < TextStyle > ;
5454
5555 /** Additional style for the cta */
5656 ctaStyle ?: TextStyle ;
@@ -60,6 +60,9 @@ type ConfirmationPageProps = {
6060
6161 /** Additional style for the container */
6262 containerStyle ?: ViewStyle ;
63+
64+ /** Additional style for the inner container */
65+ innerContainerStyle ?: ViewStyle ;
6366} ;
6467
6568function ConfirmationPage ( {
@@ -79,22 +82,23 @@ function ConfirmationPage({
7982 ctaStyle,
8083 footerStyle,
8184 containerStyle,
85+ innerContainerStyle,
8286} : ConfirmationPageProps ) {
8387 const styles = useThemeStyles ( ) ;
8488 const isLottie = isIllustrationLottieAnimation ( illustration ) ;
8589
8690 return (
8791 < View style = { [ styles . flex1 , containerStyle ] } >
88- < View style = { [ styles . screenCenteredContainer , styles . alignItemsCenter ] } >
92+ < View style = { [ styles . screenCenteredContainer , styles . alignItemsCenter , innerContainerStyle ] } >
8993 { isLottie ? (
9094 < Lottie
9195 source = { illustration }
9296 autoPlay
9397 loop
9498 style = { [ styles . confirmationAnimation , illustrationStyle ] }
9599 webStyle = { {
96- width : ( illustrationStyle ?. width as number ) ?? styles . confirmationAnimation . width ,
97- height : ( illustrationStyle ?. height as number ) ?? styles . confirmationAnimation . height ,
100+ width : ( StyleSheet . flatten ( illustrationStyle ) ?. width as number ) ?? styles . confirmationAnimation . width ,
101+ height : ( StyleSheet . flatten ( illustrationStyle ) ?. height as number ) ?? styles . confirmationAnimation . height ,
98102 } }
99103 />
100104 ) : (
0 commit comments