Haptic on profile buttons (#6034)
* play haptic on profile buttons * change react import
This commit is contained in:
@@ -10,6 +10,7 @@ import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {useActorStatus} from '#/lib/actor-status'
|
||||
import {useHaptics} from '#/lib/haptics'
|
||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {logger} from '#/logger'
|
||||
@@ -79,12 +80,14 @@ let ProfileHeaderStandard = ({
|
||||
profile.viewer?.blocking ||
|
||||
profile.viewer?.blockedBy ||
|
||||
profile.viewer?.blockingByList
|
||||
const playHaptic = useHaptics()
|
||||
|
||||
const editProfileControl = useDialogControl()
|
||||
|
||||
const onPressFollow = () => {
|
||||
setShowSuggestedFollows(true)
|
||||
playHaptic()
|
||||
requireAuth(async () => {
|
||||
setShowSuggestedFollows(true)
|
||||
try {
|
||||
await queueFollow()
|
||||
Toast.show(
|
||||
@@ -105,6 +108,7 @@ let ProfileHeaderStandard = ({
|
||||
}
|
||||
|
||||
const onPressUnfollow = () => {
|
||||
playHaptic()
|
||||
setShowSuggestedFollows(false)
|
||||
requireAuth(async () => {
|
||||
try {
|
||||
@@ -127,6 +131,7 @@ let ProfileHeaderStandard = ({
|
||||
}
|
||||
|
||||
const unblockAccount = useCallback(async () => {
|
||||
playHaptic()
|
||||
try {
|
||||
await queueUnblock()
|
||||
Toast.show(_(msg({message: 'Account unblocked', context: 'toast'})))
|
||||
@@ -136,7 +141,7 @@ let ProfileHeaderStandard = ({
|
||||
Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark')
|
||||
}
|
||||
}
|
||||
}, [_, queueUnblock])
|
||||
}, [_, queueUnblock, playHaptic])
|
||||
|
||||
const isMe = useMemo(
|
||||
() => currentAccount?.did === profile.did,
|
||||
|
||||
Reference in New Issue
Block a user