@open-tender/utils 0.1.163 → 0.1.164
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CartCounts,
|
|
2
|
-
export declare const useOrderItem: (orderItem: CartItem, favorite?:
|
|
1
|
+
import { CartCounts, CartItem, ThemeMenuItemsContentDescription, MenuItemFavorite } from '@open-tender/types';
|
|
2
|
+
export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavorite | null, allergenAlerts?: string[], cartCounts?: CartCounts, showCals?: boolean, showTags?: boolean, showAllergens?: boolean, showDesc?: ThemeMenuItemsContentDescription) => {
|
|
3
3
|
displayDesc: string | null;
|
|
4
4
|
displayTags: string[];
|
|
5
5
|
displayAllergens: string[];
|
|
@@ -33,9 +33,11 @@ const useOrderItem = (orderItem, favorite = null, allergenAlerts = [], cartCount
|
|
|
33
33
|
? shortDescription
|
|
34
34
|
: description;
|
|
35
35
|
const optionNames = favorite
|
|
36
|
-
?
|
|
36
|
+
? groups
|
|
37
37
|
.reduce((arr, group) => {
|
|
38
|
-
const names = group.options
|
|
38
|
+
const names = group.options
|
|
39
|
+
.filter(o => o.quantity > 0)
|
|
40
|
+
.map(o => o.name);
|
|
39
41
|
return [...arr, ...names];
|
|
40
42
|
}, [])
|
|
41
43
|
.join(', ')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CartCounts,
|
|
2
|
-
export declare const useOrderItem: (orderItem: CartItem, favorite?:
|
|
1
|
+
import { CartCounts, CartItem, ThemeMenuItemsContentDescription, MenuItemFavorite } from '@open-tender/types';
|
|
2
|
+
export declare const useOrderItem: (orderItem: CartItem, favorite?: MenuItemFavorite | null, allergenAlerts?: string[], cartCounts?: CartCounts, showCals?: boolean, showTags?: boolean, showAllergens?: boolean, showDesc?: ThemeMenuItemsContentDescription) => {
|
|
3
3
|
displayDesc: string | null;
|
|
4
4
|
displayTags: string[];
|
|
5
5
|
displayAllergens: string[];
|
|
@@ -30,9 +30,11 @@ export const useOrderItem = (orderItem, favorite = null, allergenAlerts = [], ca
|
|
|
30
30
|
? shortDescription
|
|
31
31
|
: description;
|
|
32
32
|
const optionNames = favorite
|
|
33
|
-
?
|
|
33
|
+
? groups
|
|
34
34
|
.reduce((arr, group) => {
|
|
35
|
-
const names = group.options
|
|
35
|
+
const names = group.options
|
|
36
|
+
.filter(o => o.quantity > 0)
|
|
37
|
+
.map(o => o.name);
|
|
36
38
|
return [...arr, ...names];
|
|
37
39
|
}, [])
|
|
38
40
|
.join(', ')
|
package/package.json
CHANGED