@giphy/react-native-sdk
Version:
Giphy React Native SDK
35 lines • 1.22 kB
JavaScript
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import React from 'react';
import NativeGiphyMediaView, { Commands } from './specs/GiphyMediaViewNativeComponent';
export class GiphyMediaView extends React.Component {
ref = /*#__PURE__*/React.createRef();
pause = () => {
if (this.ref.current) {
Commands.pause(this.ref.current);
}
};
resume = () => {
if (this.ref.current) {
Commands.resume(this.ref.current);
}
};
render() {
const {
autoPlay = true,
renditionType = 'fixed_width',
media,
showCheckeredBackground = false,
resizeMode = 'cover',
...other
} = this.props;
return /*#__PURE__*/React.createElement(NativeGiphyMediaView, _extends({
ref: this.ref,
autoPlay: autoPlay,
mediaId: media?.id,
renditionType: renditionType,
resizeMode: resizeMode,
showCheckeredBackground: showCheckeredBackground
}, other));
}
}
//# sourceMappingURL=GiphyMediaView.js.map