Skip to content

Commit

Permalink
[PAY-1569] Update blog post link (#3719)
Browse files Browse the repository at this point in the history
  • Loading branch information
piazzatron authored Jul 7, 2023
1 parent 58070df commit 8a4b7e8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
3 changes: 3 additions & 0 deletions packages/common/src/utils/chatUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { Status } from 'models/Status'

import { MESSAGE_GROUP_THRESHOLD_MINUTES } from './constants'

export const CHAT_BLOG_POST_URL =
'http://support.audius.co/help/How-to-Send-Messages-on-Audius'

/**
* Checks to see if the message was sent within the time threshold for grouping it with the next message
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import {
chatActions,
tippingActions,
cacheUsersSelectors,
ChatPermissionAction
ChatPermissionAction,
CHAT_BLOG_POST_URL
} from '@audius/common'
import { View } from 'react-native'
import { useDispatch, useSelector } from 'react-redux'

import IconMessageLocked from 'app/assets/images/iconMessageLocked.svg'
import IconTip from 'app/assets/images/iconTip.svg'
import { Text, Button } from 'app/components/core'
import { Text, Button, useLink } from 'app/components/core'
import { NativeDrawer } from 'app/components/drawer'
import { useDrawer } from 'app/hooks/useDrawer'
import { useNavigation } from 'app/hooks/useNavigation'
Expand Down Expand Up @@ -132,10 +133,11 @@ const DrawerContent = ({ data }: DrawerContentProps) => {
closeDrawer()
}, [dispatch, userId, shouldOpenChat, canCreateChat, closeDrawer])

const { onPress: onPressLearnMore } = useLink(CHAT_BLOG_POST_URL)
const handleLearnMorePress = useCallback(() => {
// TODO: Link to blog
onPressLearnMore()
closeDrawer()
}, [closeDrawer])
}, [closeDrawer, onPressLearnMore])

const handleTipPress = useCallback(() => {
dispatch(beginTip({ user, source: 'inboxUnavailableModal' }))
Expand Down
10 changes: 7 additions & 3 deletions packages/mobile/src/screens/chat-screen/ChatUnavailable.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { useCallback, useMemo } from 'react'

import { ChatPermissionAction, useCanSendMessage } from '@audius/common'
import {
ChatPermissionAction,
useCanSendMessage,
CHAT_BLOG_POST_URL
} from '@audius/common'
import { View, Text } from 'react-native'
import { useDispatch } from 'react-redux'

import { useLink } from 'app/components/core'
import { useNavigation } from 'app/hooks/useNavigation'
import { setVisibility } from 'app/store/drawers/slice'
import { makeStyles } from 'app/styles'
Expand Down Expand Up @@ -49,8 +54,7 @@ export const ChatUnavailable = ({ chatId }: ChatUnavailableProps) => {

const { firstOtherUser: otherUser, callToAction } = useCanSendMessage(chatId)

// TODO: link to blog
const handleLearnMorePress = useCallback(() => {}, [])
const { onPress: handleLearnMorePress } = useLink(CHAT_BLOG_POST_URL)

const handleUnblockPress = useCallback(() => {
if (otherUser) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactNode, useCallback } from 'react'

import {
CHAT_BLOG_POST_URL,
ChatPermissionAction,
User,
chatActions,
Expand Down Expand Up @@ -110,7 +111,8 @@ export const InboxUnavailableModal = ({
dispatch(createChat({ userIds: [user.user_id] }))
onClose()
} else {
// TODO: Link to blog post
window.open(CHAT_BLOG_POST_URL, '_blank')
onClose()
}
}, [dispatch, onClose, user, callToAction])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const TopAPIBody = () => {
const wm = useWithMobileStyle(styles.mobile)

const onClickAudiusAPI = useCallback(() => {
window.open(AUDIUS_API_LINK, '__blank')
window.open(AUDIUS_API_LINK, '_blank')
}, [])

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useCallback, MouseEventHandler } from 'react'

import { User, ChatPermissionAction } from '@audius/common'
import { User, ChatPermissionAction, CHAT_BLOG_POST_URL } from '@audius/common'

import { UserNameAndBadges } from 'components/user-name-and-badges/UserNameAndBadges'

Expand Down Expand Up @@ -69,7 +69,7 @@ export const InboxUnavailableMessage = ({
return (
<div className={styles.root}>
{messages.default(user)}{' '}
<a href='#' target='_blank'>
<a href={CHAT_BLOG_POST_URL} target='_blank' rel='noreferrer'>
{messages.learnMore}
</a>
</div>
Expand Down

0 comments on commit 8a4b7e8

Please sign in to comment.