one
Version:
One is a React framework for web, iOS, and Android apps.
35 lines (32 loc) • 958 B
JavaScript
import { jsx } from "react/jsx-runtime";
import { Platform, requireNativeComponent } from "react-native";
var isAvailable = Platform.OS === "ios" && !Platform.isTV;
var ToolbarHostNative = isAvailable ? requireNativeComponent("OneToolbarHost") : null;
function ToolbarHost(props) {
if (!ToolbarHostNative) return null;
return /* @__PURE__ */ jsx(ToolbarHostNative, {
...props,
style: {
position: "absolute",
top: 0,
left: 0,
width: 1,
height: 1,
backgroundColor: "transparent"
}
});
}
var ToolbarItemNative = isAvailable ? requireNativeComponent("OneToolbarItem") : null;
function ToolbarItem(props) {
if (!ToolbarItemNative) return null;
var { image, onSelected, ...rest } = props;
return /* @__PURE__ */ jsx(ToolbarItemNative, {
...rest,
imageSource: image,
onSelected: onSelected ? function() {
return onSelected();
} : void 0
});
}
export { ToolbarHost, ToolbarItem };
//# sourceMappingURL=index.native.js.map