one
Version:
One is a React framework for web, iOS, and Android apps.
61 lines (58 loc) • 2.03 kB
JavaScript
;
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 index_native_exports = {};
__export(index_native_exports, {
ToolbarHost: () => ToolbarHost,
ToolbarItem: () => ToolbarItem
});
module.exports = __toCommonJS(index_native_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_react_native = require("react-native");
var isAvailable = import_react_native.Platform.OS === "ios" && !import_react_native.Platform.isTV;
var ToolbarHostNative = isAvailable ? (0, import_react_native.requireNativeComponent)("OneToolbarHost") : null;
function ToolbarHost(props) {
if (!ToolbarHostNative) return null;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolbarHostNative, {
...props,
style: {
position: "absolute",
top: 0,
left: 0,
width: 1,
height: 1,
backgroundColor: "transparent"
}
});
}
var ToolbarItemNative = isAvailable ? (0, import_react_native.requireNativeComponent)("OneToolbarItem") : null;
function ToolbarItem(props) {
if (!ToolbarItemNative) return null;
var { image, onSelected, ...rest } = props;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolbarItemNative, {
...rest,
imageSource: image,
onSelected: onSelected ? function() {
return onSelected();
} : void 0
});
}
//# sourceMappingURL=index.native.js.map