One more haptic tweak (#5979)
* remove 10ms delay and make light * make like haptic light * same for PostThreadComposePrompt
This commit is contained in:
@@ -5,7 +5,6 @@ import {useLingui} from '@lingui/react'
|
|||||||
|
|
||||||
import {PressableScale} from '#/lib/custom-animations/PressableScale'
|
import {PressableScale} from '#/lib/custom-animations/PressableScale'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {isIOS} from '#/platform/detection'
|
|
||||||
import {useProfileQuery} from '#/state/queries/profile'
|
import {useProfileQuery} from '#/state/queries/profile'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
||||||
@@ -45,11 +44,7 @@ export function PostThreadComposePrompt({
|
|||||||
onPressIn={ios(() => playHaptic('Light'))}
|
onPressIn={ios(() => playHaptic('Light'))}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
onPressCompose()
|
onPressCompose()
|
||||||
if (isIOS) {
|
|
||||||
setTimeout(() => playHaptic('Medium'), 10)
|
|
||||||
} else {
|
|
||||||
playHaptic('Light')
|
playHaptic('Light')
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
onLongPress={ios(() => {
|
onLongPress={ios(() => {
|
||||||
onPressCompose()
|
onPressCompose()
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {useMinimalShellFabTransform} from '#/lib/hooks/useMinimalShellTransform'
|
|||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {clamp} from '#/lib/numbers'
|
import {clamp} from '#/lib/numbers'
|
||||||
import {gradients} from '#/lib/styles'
|
import {gradients} from '#/lib/styles'
|
||||||
import {isIOS, isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import {ios} from '#/alf'
|
import {ios} from '#/alf'
|
||||||
|
|
||||||
export interface FABProps
|
export interface FABProps
|
||||||
@@ -44,11 +44,7 @@ export function FABInner({testID, icon, onPress, ...props}: FABProps) {
|
|||||||
onPressIn={ios(() => playHaptic('Light'))}
|
onPressIn={ios(() => playHaptic('Light'))}
|
||||||
onPress={evt => {
|
onPress={evt => {
|
||||||
onPress?.(evt)
|
onPress?.(evt)
|
||||||
if (isIOS) {
|
|
||||||
setTimeout(() => playHaptic('Medium'), 10)
|
|
||||||
} else {
|
|
||||||
playHaptic('Light')
|
playHaptic('Light')
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
onLongPress={ios((evt: any) => {
|
onLongPress={ios((evt: any) => {
|
||||||
onPress?.(evt)
|
onPress?.(evt)
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ let PostCtrls = ({
|
|||||||
try {
|
try {
|
||||||
setIsToggleLikeIcon(true)
|
setIsToggleLikeIcon(true)
|
||||||
if (!post.viewer?.like) {
|
if (!post.viewer?.like) {
|
||||||
playHaptic()
|
playHaptic('Light')
|
||||||
sendInteraction({
|
sendInteraction({
|
||||||
item: post.uri,
|
item: post.uri,
|
||||||
event: 'app.bsky.feed.defs#interactionLike',
|
event: 'app.bsky.feed.defs#interactionLike',
|
||||||
|
|||||||
Reference in New Issue
Block a user