Skip to content

Commit 9e99b67

Browse files
committed
Redirect to landing when trying to open pricing modal
1 parent 972b380 commit 9e99b67

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/components/src/components/modals/PricingModal.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
33
import { FlatList, FlatListProps, View } from 'react-native'
44
import { useDispatch } from 'react-redux'
55

6+
import { useDynamicRef } from '../../hooks/use-dynamic-ref'
67
import { useReduxState } from '../../hooks/use-redux-state'
78
import { Browser } from '../../libs/browser'
89
import { bugsnag } from '../../libs/bugsnag'
@@ -115,6 +116,16 @@ export function PricingModal(props: PricingModalProps) {
115116
[plansToShow],
116117
)
117118

119+
const appTokenRef = useDynamicRef(appToken)
120+
useEffect(() => {
121+
if (allowChangePlansOnThisApp) return
122+
123+
dispatch(actions.closeAllModals())
124+
Browser.openURLOnNewTab(
125+
`${constants.DEVHUB_LINKS.PRICING_PAGE}?appToken=${appTokenRef.current}&hideFreePlan`,
126+
)
127+
}, [])
128+
118129
useEffect(() => {
119130
scrollToPlan(selectedPlanId)
120131
}, [scrollToPlan, selectedPlanId])

0 commit comments

Comments
 (0)