Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/App into fix/task-assigne…
Browse files Browse the repository at this point in the history
…e-modal-transition
  • Loading branch information
b4s36t4 committed Sep 12, 2023
2 parents 82fd1db + 662af46 commit c0e23a2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 33 deletions.
32 changes: 0 additions & 32 deletions src/libs/HapticFeedback/index.native.js

This file was deleted.

27 changes: 27 additions & 0 deletions src/libs/HapticFeedback/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import HapticFeedback from './types';

const hapticFeedback: HapticFeedback = {
press: () => {
ReactNativeHapticFeedback.trigger('impactLight', {
enableVibrateFallback: true,
});
},
longPress: () => {
ReactNativeHapticFeedback.trigger('impactHeavy', {
enableVibrateFallback: true,
});
},
success: () => {
ReactNativeHapticFeedback.trigger('notificationSuccess', {
enableVibrateFallback: true,
});
},
error: () => {
ReactNativeHapticFeedback.trigger('notificationError', {
enableVibrateFallback: true,
});
},
};

export default hapticFeedback;
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import HapticFeedback from './types';

/**
* Web does not support Haptic feedback
*/
export default {
const hapticFeedback: HapticFeedback = {
press: () => {},
longPress: () => {},
success: () => {},
error: () => {},
};

export default hapticFeedback;
8 changes: 8 additions & 0 deletions src/libs/HapticFeedback/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type HapticFeedback = {
press: () => void;
longPress: () => void;
success: () => void;
error: () => void;
};

export default HapticFeedback;

0 comments on commit c0e23a2

Please sign in to comment.