@open-tender/utils 0.1.119 → 0.1.120
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.
package/dist/.DS_Store
CHANGED
|
Binary file
|
|
@@ -22,6 +22,7 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
|
|
|
22
22
|
hasInfo: boolean | "" | null;
|
|
23
23
|
hasMadeFor: boolean;
|
|
24
24
|
hasNotes: boolean;
|
|
25
|
+
hasSelections: boolean;
|
|
25
26
|
cartGuestId: number | null;
|
|
26
27
|
customerId: number | null;
|
|
27
28
|
index?: number | undefined;
|
|
@@ -30,6 +30,10 @@ const useMenuItem = (builtItem, auth, lookup, cartId, displaySettings) => {
|
|
|
30
30
|
const isIncomplete = totalPrice === 0 || quantity === 0 || groupsBelowMin;
|
|
31
31
|
const requiresCustomization = isIncomplete && !missingSize;
|
|
32
32
|
const nonSizeGroups = groups ? groups.filter(i => !i.isSize) : null;
|
|
33
|
+
const currentOptions = nonSizeGroups
|
|
34
|
+
? (0, utils_1.getItemOptions)(Object.assign(Object.assign({}, builtItem), { groups: nonSizeGroups }))
|
|
35
|
+
: [];
|
|
36
|
+
const hasSelections = currentOptions.length > 0;
|
|
33
37
|
const hasMadeFor = showMadeFor && !cartId ? true : false;
|
|
34
38
|
const hasNotes = showNotes ? true : false;
|
|
35
39
|
const hasIngredients = ingredients && ingredients.length > 0;
|
|
@@ -56,6 +60,7 @@ const useMenuItem = (builtItem, auth, lookup, cartId, displaySettings) => {
|
|
|
56
60
|
hasIngredients,
|
|
57
61
|
hasInfo,
|
|
58
62
|
hasMadeFor,
|
|
59
|
-
hasNotes
|
|
63
|
+
hasNotes,
|
|
64
|
+
hasSelections });
|
|
60
65
|
};
|
|
61
66
|
exports.useMenuItem = useMenuItem;
|
|
@@ -22,6 +22,7 @@ export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, looku
|
|
|
22
22
|
hasInfo: boolean | "" | null;
|
|
23
23
|
hasMadeFor: boolean;
|
|
24
24
|
hasNotes: boolean;
|
|
25
|
+
hasSelections: boolean;
|
|
25
26
|
cartGuestId: number | null;
|
|
26
27
|
customerId: number | null;
|
|
27
28
|
index?: number | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatDollars, hasGroupsBelowMin, makeItemSignature } from '../utils';
|
|
1
|
+
import { formatDollars, getItemOptions, hasGroupsBelowMin, makeItemSignature } from '../utils';
|
|
2
2
|
export const useMenuItem = (builtItem, auth, lookup, cartId, displaySettings) => {
|
|
3
3
|
const signature = makeItemSignature(builtItem);
|
|
4
4
|
const favoriteId = lookup && signature ? lookup[signature] : null;
|
|
@@ -27,6 +27,10 @@ export const useMenuItem = (builtItem, auth, lookup, cartId, displaySettings) =>
|
|
|
27
27
|
const isIncomplete = totalPrice === 0 || quantity === 0 || groupsBelowMin;
|
|
28
28
|
const requiresCustomization = isIncomplete && !missingSize;
|
|
29
29
|
const nonSizeGroups = groups ? groups.filter(i => !i.isSize) : null;
|
|
30
|
+
const currentOptions = nonSizeGroups
|
|
31
|
+
? getItemOptions(Object.assign(Object.assign({}, builtItem), { groups: nonSizeGroups }))
|
|
32
|
+
: [];
|
|
33
|
+
const hasSelections = currentOptions.length > 0;
|
|
30
34
|
const hasMadeFor = showMadeFor && !cartId ? true : false;
|
|
31
35
|
const hasNotes = showNotes ? true : false;
|
|
32
36
|
const hasIngredients = ingredients && ingredients.length > 0;
|
|
@@ -53,5 +57,6 @@ export const useMenuItem = (builtItem, auth, lookup, cartId, displaySettings) =>
|
|
|
53
57
|
hasIngredients,
|
|
54
58
|
hasInfo,
|
|
55
59
|
hasMadeFor,
|
|
56
|
-
hasNotes
|
|
60
|
+
hasNotes,
|
|
61
|
+
hasSelections });
|
|
57
62
|
};
|
package/package.json
CHANGED