@popmenu/ordering-ui 0.115.0 → 0.116.0

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;
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,15 @@ 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
+ },
1544
1553
  name: {
1545
1554
  fontSize: 16,
1546
1555
  fontWeight: 500,
@@ -1597,10 +1606,11 @@ var OrderingAppContextProvider = function (props) {
1597
1606
 
1598
1607
  var DishCheckoutCard = function (props) {
1599
1608
  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;
1609
+ 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;
1610
+ var src = image.src, alt = image.alt;
1601
1611
  var classes = useDishCheckoutCardStyles(props);
1602
1612
  var appContext = useOrderingAppContext()[0];
1603
- var _b = useState(false), open = _b[0], setOpen = _b[1];
1613
+ var _c = useState(false), open = _c[0], setOpen = _c[1];
1604
1614
  var formattedPrice = typeof price === 'number' ? "" + ((_a = appContext.currencySymbol) !== null && _a !== void 0 ? _a : '') + price.toFixed(2) : price;
1605
1615
  var handleQuantityChange = function (event) {
1606
1616
  return onQuantityChange(id, parseInt(event.target.value, 10));
@@ -1609,9 +1619,10 @@ var DishCheckoutCard = function (props) {
1609
1619
  return label.replace(/[^a-zA-Z\s]/g, '').toLowerCase();
1610
1620
  };
1611
1621
  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),
1622
+ React__default.createElement(Box, { display: "flex", gridGap: 3 },
1623
+ src && alt && React__default.createElement("img", { src: src, alt: alt, className: classes.img }),
1624
+ React__default.createElement(Box, { flexGrow: 1 },
1625
+ React__default.createElement(Typography, { variant: "h2", className: classes.name }, name),
1615
1626
  modifiers &&
1616
1627
  modifiers.map(function (modifier, i) { return (React__default.createElement(Typography, { key: i, variant: "body2" },
1617
1628
  modifier[0],