@@ -11,6 +11,7 @@ import {
1111} from '@devhub/core'
1212import React , { useCallback , useMemo , useRef } from 'react'
1313import { Dimensions , View } from 'react-native'
14+ import { useDispatch } from 'react-redux'
1415
1516import {
1617 getCardPropsForItem ,
@@ -33,13 +34,15 @@ import {
3334import { EmptyCards } from '../components/cards/EmptyCards'
3435import { columnHeaderHeight } from '../components/columns/ColumnHeader'
3536import { ColumnLoadingIndicator } from '../components/columns/ColumnLoadingIndicator'
37+ import { Button } from '../components/common/Button'
3638import { ButtonLink } from '../components/common/ButtonLink'
3739import { QuickFeedbackRow } from '../components/common/QuickFeedbackRow'
3840import { RefreshControl } from '../components/common/RefreshControl'
3941import { useAppLayout } from '../components/context/LayoutContext'
4042import { usePlans } from '../components/context/PlansContext'
4143import { OneListProps } from '../libs/one-list'
4244import { useSafeArea } from '../libs/safe-area-view'
45+ import * as actions from '../redux/actions'
4346import * as selectors from '../redux/selectors'
4447import { sharedStyles } from '../styles/shared'
4548import { useColumn } from './use-column'
@@ -78,6 +81,7 @@ export function useCardsProps<ItemT extends EnhancedItem>({
7881
7982 const { paidPlans } = usePlans ( )
8083
84+ const dispatch = useDispatch ( )
8185 const appToken = useReduxState ( selectors . appTokenSelector )
8286 const plan = useReduxState ( selectors . currentUserPlanSelector )
8387 const isPlanExpired = useReduxState ( selectors . isPlanExpiredSelector )
@@ -376,20 +380,26 @@ export function useCardsProps<ItemT extends EnhancedItem>({
376380 emoji = "lock"
377381 errorButtonView = {
378382 < View >
379- < ButtonLink
383+ < Button
380384 analyticsCategory = "plan_expired"
381385 analyticsLabel = "select_a_plan_button"
382- href = { `${ constants . DEVHUB_LINKS . PRICING_PAGE } ?appToken=${
383- appToken || ''
384- } `}
385- openOnNewTab
386+ onPress = { ( ) => {
387+ dispatch (
388+ actions . pushModal ( {
389+ name : 'PRICING' ,
390+ params : {
391+ highlightFeature : 'columnsLimit' ,
392+ } ,
393+ } ) ,
394+ )
395+ } }
386396 >
387397 { paidPlans . some ( ( p ) => p && p . interval )
388398 ? plan && plan . amount
389399 ? 'Switch plan ↗'
390400 : 'Select a plan ↗'
391401 : 'See available options ↗' }
392- </ ButtonLink >
402+ </ Button >
393403 </ View >
394404 }
395405 errorMessage = "You need a paid plan to keep using DevHub."
@@ -435,15 +445,21 @@ export function useCardsProps<ItemT extends EnhancedItem>({
435445 columnId = { column . id }
436446 emoji = "rocket"
437447 errorButtonView = {
438- < ButtonLink
448+ < Button
439449 analyticsLabel = "unlock_more_columns_button"
440- href = { `${ constants . DEVHUB_LINKS . PRICING_PAGE } ?appToken=${
441- appToken || ''
442- } `}
443- openOnNewTab
450+ onPress = { ( ) => {
451+ dispatch (
452+ actions . pushModal ( {
453+ name : 'PRICING' ,
454+ params : {
455+ highlightFeature : 'columnsLimit' ,
456+ } ,
457+ } ) ,
458+ )
459+ } }
444460 >
445461 Unlock more columns ↗
446- </ ButtonLink >
462+ </ Button >
447463 }
448464 errorMessage = { `You have exceeded the limit of ${
449465 plan . featureFlags . columnsLimit
@@ -502,20 +518,24 @@ export function useCardsProps<ItemT extends EnhancedItem>({
502518 columnId = { column . id }
503519 emoji = "lock"
504520 errorButtonView = {
505- < ButtonLink
521+ < Button
506522 analyticsLabel = "select_a_plan_button"
507523 analyticsCategory = "invalid_plan"
508- href = { `${ constants . DEVHUB_LINKS . PRICING_PAGE } ?appToken=${
509- appToken || ''
510- } `}
511- openOnNewTab
524+ onPress = { ( ) => {
525+ dispatch (
526+ actions . pushModal ( {
527+ name : 'PRICING' ,
528+ params : { } ,
529+ } ) ,
530+ )
531+ } }
512532 >
513533 { paidPlans . some ( ( p ) => p && p . interval )
514534 ? plan && plan . amount
515535 ? 'Switch plan ↗'
516536 : 'Select a plan ↗'
517537 : 'See available options ↗' }
518- </ ButtonLink >
538+ </ Button >
519539 }
520540 errorMessage = "You need a paid plan to keep using DevHub."
521541 errorTitle = "Upgrade to a paid plan"
0 commit comments