Move /platform/detection vars into /env (#9707)
* Add platform vars to env * Replace /platform/detection with /env
This commit is contained in:
+3
-3
@@ -2,20 +2,20 @@ import React from 'react'
|
||||
import * as Device from 'expo-device'
|
||||
import {impactAsync, ImpactFeedbackStyle} from 'expo-haptics'
|
||||
|
||||
import {isIOS, isWeb} from '#/platform/detection'
|
||||
import {useHapticsDisabled} from '#/state/preferences/disable-haptics'
|
||||
import {IS_IOS, IS_WEB} from '#/env'
|
||||
|
||||
export function useHaptics() {
|
||||
const isHapticsDisabled = useHapticsDisabled()
|
||||
|
||||
return React.useCallback(
|
||||
(strength: 'Light' | 'Medium' | 'Heavy' = 'Medium') => {
|
||||
if (isHapticsDisabled || isWeb) {
|
||||
if (isHapticsDisabled || IS_WEB) {
|
||||
return
|
||||
}
|
||||
|
||||
// Users said the medium impact was too strong on Android; see APP-537s
|
||||
const style = isIOS
|
||||
const style = IS_IOS
|
||||
? ImpactFeedbackStyle[strength]
|
||||
: ImpactFeedbackStyle.Light
|
||||
impactAsync(style)
|
||||
|
||||
Reference in New Issue
Block a user