@conductionnl/nl-design-system
Version:
NL design system components created by Conduction
33 lines (32 loc) • 2.15 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BottomNavigation = exports.BreakpointBottomNavigation = void 0;
var jsx_runtime_1 = require("react/jsx-runtime");
require("../../style/bottomNavigation.css");
var BreakpointBottomNavigation;
(function (BreakpointBottomNavigation) {
BreakpointBottomNavigation["mobile"] = "mobile";
BreakpointBottomNavigation["tablet"] = "tablet";
BreakpointBottomNavigation["desktop"] = "desktop";
})(BreakpointBottomNavigation = exports.BreakpointBottomNavigation || (exports.BreakpointBottomNavigation = {}));
/**
* This components renders a vertical menu at the bottom of the page.
*
* @returns JSX of the generated Bottom navigation.
*/
function BottomNavigation(props) {
var navigationItems = props.items.map(function (item) { return ((0, jsx_runtime_1.jsx)("a", __assign({ href: item.link }, { children: (0, jsx_runtime_1.jsx)("li", __assign({ className: "utrecht-sidenav__item" }, { children: (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("i", { className: item.icon }, void 0), " ", item.name] }, void 0) }), item.name) }), item.name)); });
return ((0, jsx_runtime_1.jsxs)("nav", __assign({ className: "utrecht-bottomNav ".concat(props.breakpoint) }, { children: [(0, jsx_runtime_1.jsx)("ul", __assign({ className: "navbar nav" }, { children: navigationItems }), void 0), props.pageDescription !== null && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsx)("p", __assign({ className: "utrecht-paragraph" }, { children: props.pageDescription }), void 0)] }, void 0))] }), void 0));
}
exports.BottomNavigation = BottomNavigation;