@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
24 lines (23 loc) • 1.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var hooks_1 = require("../app/hooks");
var slices_1 = require("../slices");
var Quantity = function (_a) {
var quantity = _a.quantity, increment = _a.increment, _b = _a.incrementDisabled, incrementDisabled = _b === void 0 ? false : _b, decrement = _a.decrement, _c = _a.decrementDisabled, decrementDisabled = _c === void 0 ? false : _c, _d = _a.fontSize, fontSize = _d === void 0 ? 28 : _d, _e = _a.iconSize, iconSize = _e === void 0 ? 36 : _e, _f = _a.strokeWidth, strokeWidth = _f === void 0 ? 2 : _f, _g = _a.className, className = _g === void 0 ? 'quantity' : _g, children = _a.children;
var _h = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), _j = className, config = _h[_j];
var handlers = { increment: increment, decrement: decrement };
if (!config)
return null;
return children({
config: config,
handlers: handlers,
quantity: quantity,
incrementDisabled: incrementDisabled,
decrementDisabled: decrementDisabled,
fontSize: fontSize,
iconSize: iconSize,
strokeWidth: strokeWidth,
className: className
});
};
exports.default = Quantity;