Skip to content

Commit

Permalink
Disable buy button on track screen on ios (#7971)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharit-tan authored Mar 28, 2024
1 parent 8ccc5e1 commit d60a2be
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions packages/mobile/src/components/details-tile/DetailsTileNoAccess.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ReactNode } from 'react'
import { useCallback } from 'react'
import { useFeatureFlag } from '@audius/common/hooks'

import { useStreamConditionsEntity } from '@audius/common/hooks'
import {
Expand Down Expand Up @@ -38,6 +39,7 @@ import { useDrawer } from 'app/hooks/useDrawer'
import { useNavigation } from 'app/hooks/useNavigation'
import { flexRowCentered, makeStyles } from 'app/styles'
import { spacing } from 'app/styles/spacing'
import { FeatureFlags } from '@audius/common/services'

const { getGatedContentStatusMap } = gatedContentSelectors
const { followUser } = usersSocialActions
Expand Down Expand Up @@ -204,6 +206,9 @@ export const DetailsTileNoAccess = ({
const gatedTrackStatus = gatedTrackStatusMap[trackId] ?? null
const { nftCollection, collectionLink, followee, tippedUser } =
useStreamConditionsEntity(streamConditions)
const { isEnabled: isIosGatedContentEnabled } = useFeatureFlag(
FeatureFlags.IOS_GATED_CONTENT_ENABLED
)

const { onPress: handlePressCollection } = useLink(collectionLink)

Expand Down Expand Up @@ -355,16 +360,18 @@ export const DetailsTileNoAccess = ({
{messages.lockedUSDCPurchase}
</Text>
</View>
<Button
style={[styles.mainButton, styles.buyButton]}
styles={{ icon: { width: spacing(4), height: spacing(4) } }}
title={messages.buy(
formatPrice(streamConditions.usdc_purchase.price)
)}
size='large'
onPress={handlePurchasePress}
fullWidth
/>
{isIosGatedContentEnabled && (
<Button
style={[styles.mainButton, styles.buyButton]}
styles={{ icon: { width: spacing(4), height: spacing(4) } }}
title={messages.buy(
formatPrice(streamConditions.usdc_purchase.price)
)}
size='large'
onPress={handlePurchasePress}
fullWidth
/>
)}
</>
)
}
Expand Down

0 comments on commit d60a2be

Please sign in to comment.