diff --git a/packages/mobile/src/screens/create-chat-blast-screen/ChatBlastSelectAudienceFields.tsx b/packages/mobile/src/screens/create-chat-blast-screen/ChatBlastSelectAudienceFields.tsx index 831605cff0f..fb96226d01d 100644 --- a/packages/mobile/src/screens/create-chat-blast-screen/ChatBlastSelectAudienceFields.tsx +++ b/packages/mobile/src/screens/create-chat-blast-screen/ChatBlastSelectAudienceFields.tsx @@ -2,9 +2,11 @@ import { useCallback } from 'react' import { useCurrentAccountUser } from '@audius/common/api' import { + useFeatureFlag, usePurchasersAudience, useRemixersAudience } from '@audius/common/hooks' +import { FeatureFlags } from '@audius/common/services' import { formatNumberCommas } from '@audius/common/utils' import { ChatBlastAudience } from '@audius/sdk' import { useField } from 'formik' @@ -41,6 +43,12 @@ const messages = { placeholder: 'Tracks with Remixes', filterBy: 'Filter by Tracks With Remixes', search: 'Search for tracks with remixes' + }, + coinHolders: { + label: 'Coin Holders', + description: + 'Send a bulk message to users who have Bonk coins in their wallet.', + placeholder: 'Coin Holders' } } @@ -52,6 +60,7 @@ export const ChatBlastSelectAudienceFields = () => { + ) } @@ -232,3 +241,31 @@ const RemixCreatorsMessageField = () => { /> ) } + +const CoinHoldersMessageField = () => { + const { isEnabled: isArtistCoinEnabled } = useFeatureFlag( + FeatureFlags.ARTIST_COINS + ) + const [{ value: targetAudience }] = useField(TARGET_AUDIENCE_FIELD) + const isSelected = targetAudience === ChatBlastAudience.COIN_HOLDERS + const isDisabled = !isArtistCoinEnabled + const coinHoldersCount = 0 + if (!isArtistCoinEnabled) { + return null + } + + return ( + + } + description={messages.coinHolders.description} + /> + ) +} diff --git a/packages/web/src/pages/chat-page/components/ChatBlastModal.tsx b/packages/web/src/pages/chat-page/components/ChatBlastModal.tsx index e2974f891b5..1f4353e6b08 100644 --- a/packages/web/src/pages/chat-page/components/ChatBlastModal.tsx +++ b/packages/web/src/pages/chat-page/components/ChatBlastModal.tsx @@ -1,9 +1,11 @@ import { useCurrentAccountUser } from '@audius/common/api' import { + useFeatureFlag, useFirstAvailableBlastAudience, usePurchasersAudience, useRemixersAudience } from '@audius/common/hooks' +import { FeatureFlags } from '@audius/common/services' import { useChatBlastModal, chatActions, @@ -54,6 +56,12 @@ const messages = { description: 'Send a bulk message to creators who have remixed your tracks.', placeholder: 'Tracks with Remixes' + }, + coinHolders: { + label: 'Coin Holders', + description: + 'Send a bulk message to users who have Bonk coins in their wallet.', + placeholder: 'Coin Holders' } } @@ -164,6 +172,7 @@ const ChatBlastsFields = () => { + ) @@ -339,3 +348,42 @@ const RemixCreatorsMessageField = () => { ) } + +const CoinHoldersMessageField = () => { + const [{ value: targetAudience }] = useField(TARGET_AUDIENCE_FIELD) + + const { isEnabled: isArtistCoinEnabled } = useFeatureFlag( + FeatureFlags.ARTIST_COINS + ) + + const isSelected = targetAudience === ChatBlastAudience.COIN_HOLDERS + const coinHoldersCount = 0 + const isDisabled = !isArtistCoinEnabled + if (!isArtistCoinEnabled) { + return null + } + + return ( + + + + + {isSelected ? ( + + {messages.coinHolders.description} + + ) : null} + + + ) +}