diff --git a/packages/cashier/src/pages/on-ramp/__tests__/on-ramp.spec.tsx b/packages/cashier/src/pages/on-ramp/__tests__/on-ramp.spec.tsx index e664c51bf6bb..3b3d370adc9e 100644 --- a/packages/cashier/src/pages/on-ramp/__tests__/on-ramp.spec.tsx +++ b/packages/cashier/src/pages/on-ramp/__tests__/on-ramp.spec.tsx @@ -90,6 +90,8 @@ describe('', () => { setIsOnRampModalOpen: jest.fn(), should_show_dialog: false, onramp_popup_modal_title: 'Title of the onramp popup modal', + onMountOnramp: jest.fn(), + onUnmountOnramp: jest.fn(), }, general_store: { is_loading: false, diff --git a/packages/cashier/src/pages/on-ramp/on-ramp.tsx b/packages/cashier/src/pages/on-ramp/on-ramp.tsx index 9087e5f9cdc2..3c6157915fc1 100644 --- a/packages/cashier/src/pages/on-ramp/on-ramp.tsx +++ b/packages/cashier/src/pages/on-ramp/on-ramp.tsx @@ -61,6 +61,8 @@ const OnRamp = observer(({ menu_options }: TOnRampProps) => { const { filtered_onramp_providers, is_onramp_modal_open, + onMountOnramp, + onUnmountOnramp, onramp_popup_modal_title, resetPopup, setIsOnRampModalOpen, @@ -81,6 +83,14 @@ const OnRamp = observer(({ menu_options }: TOnRampProps) => { } }, [menu_options, routeTo, selected_cashier_path]); + React.useEffect(() => { + onMountOnramp(); + + return () => { + onUnmountOnramp(); + }; + }, [onMountOnramp, onUnmountOnramp]); + const getActivePaths = () => (menu_options ?? []).map(menu_option => ({ text: menu_option.label,