@tapcart/mobile-components 0.7.48 → 0.7.49
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.
|
@@ -16,7 +16,7 @@ import { useCollection } from "./use-collection";
|
|
|
16
16
|
import { useSearchParams } from "next/navigation";
|
|
17
17
|
//@ts-expect-error
|
|
18
18
|
import { useVariables } from "@tapcart/webbridge-react";
|
|
19
|
-
import { gidFromId, countNumberOfTagsInState, getEnvState, shouldShowBlock,
|
|
19
|
+
import { gidFromId, countNumberOfTagsInState, getEnvState, shouldShowBlock, } from "../../lib/utils";
|
|
20
20
|
export const useBlockConditionalRendering = (_props, _block) => {
|
|
21
21
|
var _a, _b, _c, _d, _e;
|
|
22
22
|
const _f = ((_a = _block === null || _block === void 0 ? void 0 : _block.visibilityConditions) === null || _a === void 0 ? void 0 : _a.conditions) || {}, { enabled: conditionalsV1IsEnabled = false, exclude: isInverse = false } = _f, restOfProps = __rest(_f, ["enabled", "exclude"]);
|
|
@@ -125,6 +125,8 @@ export const useBlockConditionalRendering = (_props, _block) => {
|
|
|
125
125
|
// // If visibility conditions are disabled, always show the block
|
|
126
126
|
// shouldShow = true
|
|
127
127
|
// }
|
|
128
|
+
const blockHasTags = countNumberOfTagsInState(blockState) > 0;
|
|
129
|
+
console.log({ blockConditionalsIsEnabled, _version, blockState, blockHasTags });
|
|
128
130
|
if (blockConditionalsIsEnabled) {
|
|
129
131
|
const product = products.length === 1 ? products[0] : undefined;
|
|
130
132
|
const envState = getEnvState({
|
|
@@ -133,12 +135,11 @@ export const useBlockConditionalRendering = (_props, _block) => {
|
|
|
133
135
|
collection: specificCollection,
|
|
134
136
|
customer: customerVariables,
|
|
135
137
|
});
|
|
138
|
+
console.log({ product, envState, });
|
|
136
139
|
if (_version === 2) {
|
|
137
|
-
|
|
138
|
-
shouldShow = evaluateConditions(conditions, envState);
|
|
140
|
+
shouldShow = false; // evaluateConditions(conditions, envState)
|
|
139
141
|
}
|
|
140
142
|
else {
|
|
141
|
-
const blockHasTags = countNumberOfTagsInState(blockState) > 0;
|
|
142
143
|
if (blockHasTags) {
|
|
143
144
|
//@ts-expect-error
|
|
144
145
|
const shouldShowPreInverse = shouldShowBlock(envState, blockState);
|