UNPKG

@ua/react-native-airship

Version:
86 lines (77 loc) 1.79 kB
/* Copyright Airship and Contributors */ 'use strict'; import React from 'react'; import RNAirshipMessageView from './RNAirshipMessageViewNativeComponent'; /** * Enum of possible message load errors */ import { jsx as _jsx } from "react/jsx-runtime"; export let MessageLoadError = /*#__PURE__*/function (MessageLoadError) { /** * The message is not available. */ MessageLoadError["NotAvailable"] = "MESSAGE_NOT_AVAILABLE"; /** * Failed to fetch the message. */ MessageLoadError["FetchFailed"] = "FAILED_TO_FETCH_MESSAGE"; /** * Failed to load the message. */ MessageLoadError["LoadFailed"] = "MESSAGE_LOAD_FAILED"; return MessageLoadError; }({}); /** * Message load started event. */ /** * Message load finished event. */ /** * Message load error event. */ /** * Message closed event */ /** * MessageView props */ /** * Inbox message view component. */ export class MessageView extends React.Component { _onLoadStarted = event => { if (!this.props.onLoadStarted) { return; } this.props.onLoadStarted(event.nativeEvent); }; _onLoadFinished = event => { if (!this.props.onLoadFinished) { return; } this.props.onLoadFinished(event.nativeEvent); }; _onLoadError = event => { if (!this.props.onLoadError) { return; } this.props.onLoadError(event.nativeEvent); }; _onClose = event => { if (!this.props.onClose) { return; } this.props.onClose(event.nativeEvent); }; render() { return /*#__PURE__*/_jsx(RNAirshipMessageView, { ...this.props, onLoadError: this._onLoadError, onLoadStarted: this._onLoadStarted, onLoadFinished: this._onLoadFinished, onClose: this._onClose }); } } //# sourceMappingURL=MessageView.js.map