@popmenu/ordering-ui 0.115.0 → 0.116.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,11 @@ export interface DishCheckoutCardProps {
5
5
  modifiers?: [string, string][];
6
6
  /** Id of the dish */
7
7
  id: number;
8
+ /** Dish image information */
9
+ image: {
10
+ alt?: string;
11
+ src?: string | null;
12
+ };
8
13
  /** disables all interactive elements in the card, like "edit" or "delete" */
9
14
  disabled?: boolean;
10
15
  /** Name of the dish */
package/build/index.es.js CHANGED
@@ -1541,6 +1541,16 @@ var useDishCheckoutCardStyles = makeStyles(function (theme) { return ({
1541
1541
  editButton: {
1542
1542
  color: theme.palette.info.main,
1543
1543
  },
1544
+ img: {
1545
+ objectFit: 'cover',
1546
+ borderRadius: theme.spacing(1),
1547
+ flexBasis: 'auto',
1548
+ flexShrink: 0,
1549
+ height: theme.spacing(7),
1550
+ marginRight: theme.spacing(1),
1551
+ overflow: 'hidden',
1552
+ width: theme.spacing(7),
1553
+ },
1544
1554
  name: {
1545
1555
  fontSize: 16,
1546
1556
  fontWeight: 500,
@@ -1597,10 +1607,11 @@ var OrderingAppContextProvider = function (props) {
1597
1607
 
1598
1608
  var DishCheckoutCard = function (props) {
1599
1609
  var _a;
1600
- var id = props.id, name = props.name, quantity = props.quantity, modifiers = props.modifiers, onDelete = props.onDelete, onEdit = props.onEdit, onQuantityChange = props.onQuantityChange, price = props.price, specialInstructions = props.specialInstructions, disabled = props.disabled, warningMessage = props.warningMessage;
1610
+ var id = props.id, name = props.name, quantity = props.quantity, modifiers = props.modifiers, onDelete = props.onDelete, onEdit = props.onEdit, onQuantityChange = props.onQuantityChange, price = props.price, specialInstructions = props.specialInstructions, disabled = props.disabled, warningMessage = props.warningMessage, _b = props.image, image = _b === void 0 ? {} : _b;
1611
+ var src = image.src, alt = image.alt;
1601
1612
  var classes = useDishCheckoutCardStyles(props);
1602
1613
  var appContext = useOrderingAppContext()[0];
1603
- var _b = useState(false), open = _b[0], setOpen = _b[1];
1614
+ var _c = useState(false), open = _c[0], setOpen = _c[1];
1604
1615
  var formattedPrice = typeof price === 'number' ? "" + ((_a = appContext.currencySymbol) !== null && _a !== void 0 ? _a : '') + price.toFixed(2) : price;
1605
1616
  var handleQuantityChange = function (event) {
1606
1617
  return onQuantityChange(id, parseInt(event.target.value, 10));
@@ -1609,9 +1620,10 @@ var DishCheckoutCard = function (props) {
1609
1620
  return label.replace(/[^a-zA-Z\s]/g, '').toLowerCase();
1610
1621
  };
1611
1622
  return (React__default.createElement(Box, { className: classes.root },
1612
- React__default.createElement(Box, { display: "flex", justifyContent: "space-between", gridGap: 3 },
1613
- React__default.createElement(Box, null,
1614
- React__default.createElement(Typography, { variant: "h6", className: classes.name }, name),
1623
+ React__default.createElement(Box, { display: "flex", gridGap: 3 },
1624
+ src && alt && React__default.createElement("img", { src: src, alt: alt, className: classes.img }),
1625
+ React__default.createElement(Box, { flexGrow: 1 },
1626
+ React__default.createElement(Typography, { variant: "h2", className: classes.name }, name),
1615
1627
  modifiers &&
1616
1628
  modifiers.map(function (modifier, i) { return (React__default.createElement(Typography, { key: i, variant: "body2" },
1617
1629
  modifier[0],