@@ -7,6 +7,7 @@ import ScreenWrapper from '@components/ScreenWrapper';
7
7
import useLocalize from '@hooks/useLocalize' ;
8
8
import useThemeStyles from '@hooks/useThemeStyles' ;
9
9
import Navigation from '@libs/Navigation/Navigation' ;
10
+ import type { BackToParams } from '@libs/Navigation/types' ;
10
11
import type { FormOnyxValues } from '@src/components/Form/types' ;
11
12
import type { Country } from '@src/CONST' ;
12
13
import ONYXKEYS from '@src/ONYXKEYS' ;
@@ -22,9 +23,9 @@ type AddressPageProps = {
22
23
updateAddress : ( values : FormOnyxValues < typeof ONYXKEYS . FORMS . HOME_ADDRESS_FORM > ) => void ;
23
24
/** Title of address page */
24
25
title : string ;
25
- } ;
26
+ } & BackToParams ;
26
27
27
- function AddressPage ( { title, address, updateAddress, isLoadingApp = true } : AddressPageProps ) {
28
+ function AddressPage ( { title, address, updateAddress, isLoadingApp = true , backTo } : AddressPageProps ) {
28
29
const styles = useThemeStyles ( ) ;
29
30
const { translate} = useLocalize ( ) ;
30
31
@@ -83,7 +84,7 @@ function AddressPage({title, address, updateAddress, isLoadingApp = true}: Addre
83
84
< HeaderWithBackButton
84
85
title = { title }
85
86
shouldShowBackButton
86
- onBackButtonPress = { ( ) => Navigation . goBack ( ) }
87
+ onBackButtonPress = { ( ) => Navigation . goBack ( backTo ) }
87
88
/>
88
89
{ isLoadingApp ? (
89
90
< FullscreenLoadingIndicator style = { [ styles . flex1 , styles . pRelative ] } />
0 commit comments