UNPKG

@prosperitainova/dumbo-react-native

Version:
38 lines (36 loc) 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NavigationList = void 0; var _react = _interopRequireDefault(require("react")); var _reactNative = require("react-native"); var _NavigationListItem = require("../NavigationListItem"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** Props for NavigationList component */ /** * NavigationList component for rendering a list of navigation items * * {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/NavigationList.tsx | Example code} */ class NavigationList extends _react.default.Component { render() { const { items, componentProps, style } = this.props; const allItems = items || []; return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: style, ...(componentProps || {}), children: allItems.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_NavigationListItem.NavigationListItem, { ...item, lastItem: index + 1 === allItems.length }, index)) }); } } exports.NavigationList = NavigationList; //# sourceMappingURL=index.js.map