UNPKG

727 BJavaScriptView Raw
1import { requireNativeViewManager } from '@unimodules/core';
2import React from 'react';
3export default class BannerAd extends React.Component {
4 render() {
5 const { type, onPress, onError, style, ...props } = this.props;
6 const size = _getSizeForAdType(type);
7 return (React.createElement(NativeBannerView, Object.assign({ size: size, onAdPress: onPress, onAdError: onError, style: [style, { height: size }] }, props)));
8 }
9}
10function _getSizeForAdType(type) {
11 const sizes = { standard: 50, large: 90, rectangle: 250 };
12 return sizes.hasOwnProperty(type) ? sizes[type] : sizes.standard;
13}
14const NativeBannerView = requireNativeViewManager('CTKBannerView');
15//# sourceMappingURL=BannerAd.js.map
\No newline at end of file