mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

migrate to 'expo-haptics' (#3418)

* migrate to 'expo-haptics'

* run yarn install twice if necessary

authored by hailey.at and committed by

GitHub 4e59914d cddbbc4b

+26 -20
+2 -3
.github/workflows/pull-request-commit.yml
··· 32 32 node-version-file: .nvmrc 33 33 cache: yarn 34 34 35 - - name: ⚙️ Install Dependencies 36 - run: yarn install 37 - 38 35 - name: Ensure tracking relevant branches and checkout base 39 36 run: | 40 37 git checkout ${{ github.head_ref }} ··· 50 47 git config --global user.email "github-actions[bot]@users.noreply.github.com" 51 48 git config --global user.name "github-actions[bot]" 52 49 git merge --no-edit ${{ github.head_ref }} 50 + yarn install 53 51 54 52 - name: 🔦 Generate stats file for PR 55 53 run: | ··· 72 70 - name: 🔦 Generate stats file from base commit 73 71 if: ${{ !steps.get-base-stats.outputs.cache-hit }} 74 72 run: | 73 + yarn install 75 74 yarn generate-webpack-stats-file 76 75 mv stats.json stats-base.json 77 76
+1 -1
package.json
··· 113 113 "expo-constants": "~15.4.5", 114 114 "expo-dev-client": "~3.3.8", 115 115 "expo-device": "~5.9.3", 116 + "expo-haptics": "^12.8.1", 116 117 "expo-image": "~1.10.6", 117 118 "expo-image-manipulator": "^11.8.0", 118 119 "expo-image-picker": "~14.7.1", ··· 159 160 "react-native-fs": "^2.20.0", 160 161 "react-native-gesture-handler": "~2.14.0", 161 162 "react-native-get-random-values": "~1.11.0", 162 - "react-native-haptic-feedback": "^1.14.0", 163 163 "react-native-image-crop-picker": "^0.38.1", 164 164 "react-native-ios-context-menu": "^1.15.3", 165 165 "react-native-linear-gradient": "^2.6.2",
+18 -11
src/lib/haptics.ts
··· 1 + import { 2 + impactAsync, 3 + ImpactFeedbackStyle, 4 + notificationAsync, 5 + NotificationFeedbackType, 6 + selectionAsync, 7 + } from 'expo-haptics' 8 + 1 9 import {isIOS, isWeb} from 'platform/detection' 2 - import ReactNativeHapticFeedback, { 3 - HapticFeedbackTypes, 4 - } from 'react-native-haptic-feedback' 5 10 6 - const hapticImpact: HapticFeedbackTypes = isIOS ? 'impactMedium' : 'impactLight' // Users said the medium impact was too strong on Android; see APP-537s 11 + const hapticImpact: ImpactFeedbackStyle = isIOS 12 + ? ImpactFeedbackStyle.Medium 13 + : ImpactFeedbackStyle.Light // Users said the medium impact was too strong on Android; see APP-537s 7 14 8 15 export class Haptics { 9 16 static default() { 10 17 if (isWeb) { 11 18 return 12 19 } 13 - ReactNativeHapticFeedback.trigger(hapticImpact) 20 + impactAsync(hapticImpact) 14 21 } 15 - static impact(type: HapticFeedbackTypes = hapticImpact) { 22 + static impact(type: ImpactFeedbackStyle = hapticImpact) { 16 23 if (isWeb) { 17 24 return 18 25 } 19 - ReactNativeHapticFeedback.trigger(type) 26 + impactAsync(type) 20 27 } 21 28 static selection() { 22 29 if (isWeb) { 23 30 return 24 31 } 25 - ReactNativeHapticFeedback.trigger('selection') 32 + selectionAsync() 26 33 } 27 34 static notification = (type: 'success' | 'warning' | 'error') => { 28 35 if (isWeb) { ··· 30 37 } 31 38 switch (type) { 32 39 case 'success': 33 - return ReactNativeHapticFeedback.trigger('notificationSuccess') 40 + return notificationAsync(NotificationFeedbackType.Success) 34 41 case 'warning': 35 - return ReactNativeHapticFeedback.trigger('notificationWarning') 42 + return notificationAsync(NotificationFeedbackType.Warning) 36 43 case 'error': 37 - return ReactNativeHapticFeedback.trigger('notificationError') 44 + return notificationAsync(NotificationFeedbackType.Error) 38 45 } 39 46 } 40 47 }
+5 -5
yarn.lock
··· 11877 11877 dependencies: 11878 11878 fontfaceobserver "^2.1.0" 11879 11879 11880 + expo-haptics@^12.8.1: 11881 + version "12.8.1" 11882 + resolved "https://registry.yarnpkg.com/expo-haptics/-/expo-haptics-12.8.1.tgz#42b996763be33d661bd33bbc3b3958c3f2734b9d" 11883 + integrity sha512-ntLsHkfle8K8w9MW8pZEw92ZN3sguaGUSSIxv30fPKNeQFu7Cq/h47Qv3tONv2MO3wU48N9FbKnant6XlfptpA== 11884 + 11880 11885 expo-image-loader@~4.6.0: 11881 11886 version "4.6.0" 11882 11887 resolved "https://registry.yarnpkg.com/expo-image-loader/-/expo-image-loader-4.6.0.tgz#ca7d4fdf53125bff2091d3a2c34a3155f10df147" ··· 18602 18607 integrity sha512-4BTbDbRmS7iPdhYLRcz3PGFIpFJBwNZg9g42iwa2P6FOv9vZj/xJc678RZXnLNZzd0qd7Q3CCF6Yd+CU2eoXKQ== 18603 18608 dependencies: 18604 18609 fast-base64-decode "^1.0.0" 18605 - 18606 - react-native-haptic-feedback@^1.14.0: 18607 - version "1.14.0" 18608 - resolved "https://registry.yarnpkg.com/react-native-haptic-feedback/-/react-native-haptic-feedback-1.14.0.tgz#b50f49dedda4980b3c37c5780823f753cf3ee717" 18609 - integrity sha512-dSXZ6gAzl+W/L7BPjOpnT0bx0cgQiSr0sB3DjyDJbGIdVr4ISaktZC6gC9xYFTv2kMq0+KtbKi+dpd0WtxYZMw== 18610 18610 18611 18611 react-native-image-crop-picker@^0.38.1: 18612 18612 version "0.38.1"