UNPKG

@r3l/app

Version:
2 lines 4.1 kB
(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[24],{"../../node_modules/react-native-web/dist/exports/Easing/index.js":function(e,t,r){"use strict";var n=r("../../node_modules/react-native-web/dist/vendor/react-native/Animated/Easing.js");t.a=n.a},"./src/modules/animation/downvoteAnimation.component.js":function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return A}));var n=r("../../node_modules/@babel/runtime/helpers/typeof.js"),o=r.n(n),i=r("../../node_modules/@babel/runtime/helpers/defineProperty.js"),a=r.n(i),s=r("../../node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),u=r.n(s),c=r("../../node_modules/@babel/runtime/helpers/slicedToArray.js"),d=r.n(c),l=r("../../node_modules/react/index.js"),p=r.n(l),f=r("../../node_modules/react-redux/es/index.js"),b=r("./src/styles/index.js"),j=r("./src/utils/index.ts"),m=r("../../node_modules/react-native-web/dist/exports/Animated/index.js"),O=r("../../node_modules/react-native-web/dist/exports/Easing/index.js"),y=r("../../node_modules/prop-types/index.js"),v=r.n(y);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _={position:"absolute",top:0,padding:10,fontSize:100,backgroundColor:"transparent"};function P(e){var t=e.parent,r=e.id,n=e.destroy,o=Object(l.useState)(new m.a.Value(1)),i=d()(o,1)[0],a=Object(l.useState)(new m.a.Value(0)),s=d()(a,1)[0];return Object(l.useEffect)((function(){m.a.parallel([m.a.timing(i,{toValue:0,delay:500,duration:300,easing:O.a.in(O.a.ease),useNativeDriver:!0}),m.a.timing(s,{toValue:1,delay:0,duration:500,easing:O.a.elastic(2),useNativeDriver:!0}).start()]).start();var e=setTimeout((function(){return n(r)}),2e3);return function(){clearTimeout(e),n(r)}}),[n,r,i,s]),p.a.createElement(m.a.Text,{pointerEvents:"none",key:r,style:[w({},_),{top:t.y,transform:[{scale:s}],opacity:i}]},"👎")}P.propTypes={parent:v.a.object,id:v.a.string,destroy:v.a.func};var E=r("./src/modules/styled/index.ts");function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function D(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o()(t)?t:String(t)}var S=Object(E.M)(E.K)({position:1==b.d?"absolute":"fixed",zIndex:1e4,left:0,top:0,right:0,display:"flex",alignItems:"center",justifyContent:"center"});function A(){var e=Object(l.useState)({}),t=d()(e,2),r=t[0],n=t[1],o=Object(f.d)((function(e){return e.animation.downvote||{}})),i=o.index,s=o.parent;function c(e){n((function(t){t[e];return u()(t,[e].map(D))}))}return Object(l.useEffect)((function(){!function(){if(s){var e=j.f.guid(),t=a()({},e,p.a.createElement(P,{destroy:c,parent:s,key:e,id:e}));n((function(e){return h(h({},e),t)}))}}()}),[i,s]),p.a.createElement(S,{pointerEvents:"none"},Object.values(r))}}}]); //# sourceMappingURL=animation-downvoteAnimation-component.bundle.268c08e6b4ba67722020.js.map