@open-tender/store
Version:
A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API
28 lines (27 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var hooks_1 = require("../app/hooks");
var slices_1 = require("../slices");
var MenuOther = function (_a) {
var title = _a.title, subtitle = _a.subtitle, _b = _a.showSubtitle, showSubtitle = _b === void 0 ? true : _b, path = _a.path, item = _a.item, children = _a.children, navigate = _a.navigate;
var dispatch = (0, hooks_1.useAppDispatch)();
var apiUrl = (0, hooks_1.useAppSelector)(slices_1.selectKioskApi);
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).menuCategory;
var browse = function () {
dispatch((0, slices_1.setCurrentCategory)(null));
navigate(path);
};
var handlers = { browse: browse };
if (!config)
return null;
return children({
config: config,
handlers: handlers,
title: title,
subtitle: subtitle,
showSubtitle: showSubtitle,
item: item,
apiUrl: apiUrl
});
};
exports.default = MenuOther;