@open-tender/cloud 0.0.123 → 0.0.124

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.
@@ -88,4 +88,5 @@ export declare const selectSoldOutMsg: (state: AppState) => string;
88
88
  export declare const selectHeaderHeight: (state: AppState) => (isBrowser: boolean) => number;
89
89
  export declare const selectOutpostName: (state: AppState) => string | undefined;
90
90
  export declare const selectHasCatering: (state: AppState) => boolean;
91
+ export declare const selectCategoryType: (isMobile: boolean) => (state: AppState) => string;
91
92
  export declare const configReducer: import("redux").Reducer<ConfigState, import("redux").AnyAction>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.configReducer = exports.selectHasCatering = exports.selectOutpostName = exports.selectHeaderHeight = exports.selectSoldOutMsg = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectAccountConfig = exports.selectApi = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.selectCateringOnly = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
4
+ exports.configReducer = exports.selectCategoryType = exports.selectHasCatering = exports.selectOutpostName = exports.selectHeaderHeight = exports.selectSoldOutMsg = exports.selectContentSection = exports.selectRecaptcha = exports.selectFulfillment = exports.selectOptIns = exports.selectLightColor = exports.selectConfigRetries = exports.selectDisplaySettings = exports.selectAccountConfig = exports.selectApi = exports.selectSettings = exports.selectContent = exports.selectTheme = exports.selectBrand = exports.selectConfig = exports.selectCateringOnly = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const utils_1 = require("@open-tender/utils");
@@ -136,4 +136,12 @@ const selectHasCatering = (state) => {
136
136
  return (_a = orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) !== null && _a !== void 0 ? _a : false;
137
137
  };
138
138
  exports.selectHasCatering = selectHasCatering;
139
+ const selectCategoryType = (isMobile) => (state) => {
140
+ const { categories } = state.config.theme || {};
141
+ if (!categories)
142
+ return 'LIST';
143
+ const { desktop, mobile } = categories;
144
+ return isMobile ? mobile.displayType : desktop.displayType;
145
+ };
146
+ exports.selectCategoryType = selectCategoryType;
139
147
  exports.configReducer = configSlice.reducer;
@@ -88,4 +88,5 @@ export declare const selectSoldOutMsg: (state: AppState) => string;
88
88
  export declare const selectHeaderHeight: (state: AppState) => (isBrowser: boolean) => number;
89
89
  export declare const selectOutpostName: (state: AppState) => string | undefined;
90
90
  export declare const selectHasCatering: (state: AppState) => boolean;
91
+ export declare const selectCategoryType: (isMobile: boolean) => (state: AppState) => string;
91
92
  export declare const configReducer: import("redux").Reducer<ConfigState, import("redux").AnyAction>;
@@ -113,4 +113,11 @@ export const selectHasCatering = (state) => {
113
113
  const { orderTypes } = state.config.settings || {};
114
114
  return (_a = orderTypes === null || orderTypes === void 0 ? void 0 : orderTypes.includes('CATERING')) !== null && _a !== void 0 ? _a : false;
115
115
  };
116
+ export const selectCategoryType = (isMobile) => (state) => {
117
+ const { categories } = state.config.theme || {};
118
+ if (!categories)
119
+ return 'LIST';
120
+ const { desktop, mobile } = categories;
121
+ return isMobile ? mobile.displayType : desktop.displayType;
122
+ };
116
123
  export const configReducer = configSlice.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.0.123",
3
+ "version": "0.0.124",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -55,7 +55,7 @@
55
55
  "react": "^18.2.0"
56
56
  },
57
57
  "dependencies": {
58
- "@open-tender/types": "^0.0.122",
59
- "@open-tender/utils": "^0.0.46"
58
+ "@open-tender/types": "^0.0.123",
59
+ "@open-tender/utils": "^0.0.48"
60
60
  }
61
61
  }