@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
26 lines (25 loc) • 946 B
JavaScript
import { useAppDispatch, useAppSelector } from '../app/hooks';
import { selectKioskApi, selectKioskConfig, setCurrentCategory } from '../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 = useAppDispatch();
var apiUrl = useAppSelector(selectKioskApi);
var config = useAppSelector(selectKioskConfig).menuCategory;
var browse = function () {
dispatch(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
});
};
export default MenuOther;