@@ -22,15 +22,27 @@ type ConfirmationPageProps = {
22
22
/** Description of the confirmation page */
23
23
description : React . ReactNode ;
24
24
25
- /** The text for the button label */
25
+ /** The text for the call to action */
26
+ cta ?: React . ReactNode ;
27
+
28
+ /** The text for the primary button label */
26
29
buttonText ?: string ;
27
30
28
- /** A function that is called when the button is clicked on */
31
+ /** A function that is called when the primary button is clicked on */
29
32
onButtonPress ?: ( ) => void ;
30
33
31
- /** Whether we should show a confirmation button */
34
+ /** Whether we should show a primary confirmation button */
32
35
shouldShowButton ?: boolean ;
33
36
37
+ /** The text for the secondary button label */
38
+ secondaryButtonText ?: string ;
39
+
40
+ /** A function that is called when the secondary button is clicked on */
41
+ onSecondaryButtonPress ?: ( ) => void ;
42
+
43
+ /** Whether we should show a secondary confirmation button */
44
+ shouldShowSecondaryButton ?: boolean ;
45
+
34
46
/** Additional style for the heading */
35
47
headingStyle ?: TextStyle ;
36
48
@@ -40,6 +52,12 @@ type ConfirmationPageProps = {
40
52
/** Additional style for the description */
41
53
descriptionStyle ?: TextStyle ;
42
54
55
+ /** Additional style for the cta */
56
+ ctaStyle ?: TextStyle ;
57
+
58
+ /** Additional style for the footer */
59
+ footerStyle ?: ViewStyle ;
60
+
43
61
/** Additional style for the container */
44
62
containerStyle ?: ViewStyle ;
45
63
} ;
@@ -48,12 +66,18 @@ function ConfirmationPage({
48
66
illustration = LottieAnimations . Fireworks ,
49
67
heading,
50
68
description,
69
+ cta,
51
70
buttonText = '' ,
52
71
onButtonPress = ( ) => { } ,
53
72
shouldShowButton = false ,
73
+ secondaryButtonText = '' ,
74
+ onSecondaryButtonPress = ( ) => { } ,
75
+ shouldShowSecondaryButton = false ,
54
76
headingStyle,
55
77
illustrationStyle,
56
78
descriptionStyle,
79
+ ctaStyle,
80
+ footerStyle,
57
81
containerStyle,
58
82
} : ConfirmationPageProps ) {
59
83
const styles = useThemeStyles ( ) ;
@@ -68,6 +92,10 @@ function ConfirmationPage({
68
92
autoPlay
69
93
loop
70
94
style = { [ styles . confirmationAnimation , illustrationStyle ] }
95
+ webStyle = { {
96
+ width : ( illustrationStyle ?. width as number ) ?? styles . confirmationAnimation . width ,
97
+ height : ( illustrationStyle ?. height as number ) ?? styles . confirmationAnimation . height ,
98
+ } }
71
99
/>
72
100
) : (
73
101
< View style = { [ styles . confirmationAnimation , illustrationStyle ] } >
@@ -79,18 +107,30 @@ function ConfirmationPage({
79
107
) }
80
108
< Text style = { [ styles . textHeadline , styles . textAlignCenter , styles . mv2 , headingStyle ] } > { heading } </ Text >
81
109
< Text style = { [ styles . textAlignCenter , descriptionStyle ] } > { description } </ Text >
110
+ { cta ? < Text style = { [ styles . textAlignCenter , ctaStyle ] } > { cta } </ Text > : null }
82
111
</ View >
83
- { shouldShowButton && (
84
- < FixedFooter >
85
- < Button
86
- success
87
- large
88
- text = { buttonText }
89
- testID = "confirmation-button"
90
- style = { styles . mt6 }
91
- pressOnEnter
92
- onPress = { onButtonPress }
93
- />
112
+ { ( shouldShowSecondaryButton || shouldShowButton ) && (
113
+ < FixedFooter style = { footerStyle } >
114
+ { shouldShowSecondaryButton && (
115
+ < Button
116
+ large
117
+ text = { secondaryButtonText }
118
+ testID = "confirmation-secondary-button"
119
+ style = { styles . mt3 }
120
+ onPress = { onSecondaryButtonPress }
121
+ />
122
+ ) }
123
+ { shouldShowButton && (
124
+ < Button
125
+ success
126
+ large
127
+ text = { buttonText }
128
+ testID = "confirmation-primary-button"
129
+ style = { styles . mt3 }
130
+ pressOnEnter
131
+ onPress = { onButtonPress }
132
+ />
133
+ ) }
94
134
</ FixedFooter >
95
135
) }
96
136
</ View >
@@ -100,3 +140,5 @@ function ConfirmationPage({
100
140
ConfirmationPage . displayName = 'ConfirmationPage' ;
101
141
102
142
export default ConfirmationPage ;
143
+
144
+ export type { ConfirmationPageProps } ;
0 commit comments