gather-content-ui
Version:
GatherContent UI Library
35 lines (34 loc) • 1.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Navigation = Navigation;
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function Navigation(props) {
var classes = (0, _classnames["default"])("gui-navigation ".concat(props.className), {
"gui-navigation--tabs": props.tabs
});
return /*#__PURE__*/_react["default"].createElement("nav", {
className: classes
}, _react["default"].Children.map(props.children, function (child) {
if (child !== null && child !== void 0 && child.props) {
var itemClasses = (0, _classnames["default"])("gui-navigation__item", child.props.className || "", {
"gui-navigation__item--active": child.props.active
});
var newProps = {
className: itemClasses
};
return /*#__PURE__*/_react["default"].cloneElement(child, newProps);
}
return null;
}));
}
Navigation.defaultProps = {
tabs: false,
className: ""
};
var _default = exports["default"] = Navigation;
//# sourceMappingURL=index.js.map