Skip to content

Commit

Permalink
[PAY-3940] Listen streak reminder mobile notif analytics (#11446)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharit-tan authored Feb 24, 2025
1 parent 4e75f5d commit ad1b826
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useCallback } from 'react'

import { listenStreakReminderMessages as messages } from '@audius/common/messages'
import { ChallengeName } from '@audius/common/models'
import { ChallengeName, Name } from '@audius/common/models'
import type { ListenStreakReminderNotification as ListenStreakReminderNotificationType } from '@audius/common/store'
import { audioRewardsPageActions, modalsActions } from '@audius/common/store'
import { make, useRecord } from 'common/store/analytics/actions'
import { Text } from 'react-native'
import { useDispatch } from 'react-redux'

Expand All @@ -29,7 +30,9 @@ export const ListenStreakReminderNotification = (
props: ListenStreakReminderNotificationProps
) => {
const { notification } = props
const { type } = notification
const dispatch = useDispatch()
const record = useRecord()

const handlePress = useCallback(() => {
dispatch(
Expand All @@ -38,7 +41,8 @@ export const ListenStreakReminderNotification = (
})
)
dispatch(setVisibility({ modal: 'ChallengeRewards', visible: true }))
}, [dispatch])
record(make(Name.NOTIFICATIONS_CLICK_TILE, { kind: type, link_to: '' }))
}, [dispatch, record, type])

return (
<NotificationTile notification={notification} onPress={handlePress}>
Expand Down

0 comments on commit ad1b826

Please sign in to comment.