UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

111 lines (109 loc) 3.7 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var RouteErrorView_exports = {}; __export(RouteErrorView_exports, { RouteErrorView: () => RouteErrorView }); module.exports = __toCommonJS(RouteErrorView_exports); var import_jsx_runtime = require("react/jsx-runtime"); var import_react_native = require("react-native"); function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } } function RouteErrorView(param) { var { routeName, error, errorInfo, onRetry } = param; return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.SafeAreaView, { style: { backgroundColor: "#000" }, children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.View, { style: { margin: 16, gap: 16 }, children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.Text, { style: { alignSelf: "flex-start", padding: 5, margin: -5, backgroundColor: "red", color: "white", fontSize: 20, fontFamily: "monospace" }, children: ['Error on route "', routeName, '"'] }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Text, { style: { color: "white", fontSize: 16, fontFamily: "monospace" }, children: _instanceof(error, Error) ? error.message : String(error) }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.TouchableOpacity, { onPress: onRetry, children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Text, { style: { alignSelf: "flex-start", margin: -6, padding: 6, backgroundColor: "white", color: "black", fontSize: 14, fontFamily: "monospace" }, children: "Retry" }) }), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.ScrollView, { contentContainerStyle: { gap: 12 }, children: [_instanceof(error, Error) ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Text, { style: { color: "white", fontSize: 12, fontFamily: "monospace" }, children: error.stack }) : null, (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack) ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.Text, { style: { color: "white", fontSize: 12, fontFamily: "monospace" }, children: ["Component Stack: ", errorInfo.componentStack] }) : null] })] }) }); } //# sourceMappingURL=RouteErrorView.native.js.map