react-native-ui-lib
Version:
<p align="center"> <img src="https://user-images.githubusercontent.com/1780255/105469025-56759000-5ca0-11eb-993d-3568c1fd54f4.png" height="250px" style="display:block"/> </p> <p align="center">UI Toolset & Components Library for React Native</p> <p a
29 lines (26 loc) • 916 B
JavaScript
import { HapticFeedbackPackage } from "../optionalDependencies";
const options = {
enableVibrateFallback: false,
ignoreAndroidSystemSettings: false
};
export let HapticType;
(function (HapticType) {
HapticType["selection"] = "selection";
HapticType["impactLight"] = "impactLight";
HapticType["impactMedium"] = "impactMedium";
HapticType["impactHeavy"] = "impactHeavy";
HapticType["notificationSuccess"] = "notificationSuccess";
HapticType["notificationWarning"] = "notificationWarning";
HapticType["notificationError"] = "notificationError";
})(HapticType || (HapticType = {}));
function triggerHaptic(hapticType, componentName) {
if (HapticFeedbackPackage) {
HapticFeedbackPackage.trigger(hapticType, options);
} else {
console.error(`RNUILib ${componentName}'s requires installing "react-native-haptic-feedback" dependency`);
}
}
export default {
HapticType,
triggerHaptic
};