UNPKG

react-native-micro-interactions

Version:

Effortlessly enhance your React Native components with subtle micro-interactions and animations.

53 lines (51 loc) 1.06 kB
"use strict"; import { createContext, useContext } from "react"; import { AnimationConfig } from "../constants/defaults.js"; import { jsx as _jsx } from "react/jsx-runtime"; const MintContext = /*#__PURE__*/createContext(AnimationConfig({ "click": { shrink: 0.9, shrinkDuration: 50 }, "buzz": { frequency: 2, rotation: 2, duration: 50 }, "popIn": { duration: 250, withBounce: true }, "dropIn": { duration: 250, withBounce: true, damping: 10 }, "textSlideVertical": { duration: 100, offset: 30 }, "textSlideHorizontal": { duration: 100, offset: 30 } })); // export default MintContext.Provider; export const MintProvider = ({ config, children }) => { return /*#__PURE__*/_jsx(MintContext.Provider, { value: config, children: children }); }; export const useConfig = () => { try { const ctx = useContext(MintContext); return ctx; } catch (e) { throw new Error("Please wrap your App in MintProvider!"); } }; //# sourceMappingURL=MintProvider.js.map