@open-tender/store 1.1.59 → 1.1.61
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/cjs/components/CategoryNav.js +4 -1
- package/dist/cjs/components/Header.d.ts +2 -1
- package/dist/cjs/components/Header.js +6 -2
- package/dist/esm/components/CategoryNav.js +6 -2
- package/dist/esm/components/Header.d.ts +2 -1
- package/dist/esm/components/Header.js +6 -2
- package/package.json +1 -1
|
@@ -8,8 +8,11 @@ var CategoryNavItem_1 = tslib_1.__importDefault(require("./CategoryNavItem"));
|
|
|
8
8
|
var CategoryNavOther_1 = tslib_1.__importDefault(require("./CategoryNavOther"));
|
|
9
9
|
var CategoryNav = function (_a) {
|
|
10
10
|
var children = _a.children, navigate = _a.navigate, apiUrl = _a.apiUrl, CategoryNavOtherView = _a.CategoryNavOtherView, CategoryNavItemView = _a.CategoryNavItemView;
|
|
11
|
+
var customer = ((0, hooks_1.useAppSelector)(slices_1.selectCustomerIdentified) || {}).customer;
|
|
11
12
|
var categoryNav = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).categoryNav;
|
|
12
|
-
var _b = (0, hooks_1.useAppSelector)(slices_1.selectMenu), categories = _b.categories, featured = _b.featured,
|
|
13
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectMenu), categories = _b.categories, featured = _b.featured, rest = tslib_1.__rest(_b, ["categories", "featured"]);
|
|
14
|
+
var favorites = customer ? rest.favorites : [];
|
|
15
|
+
var recents = customer ? rest.recents : [];
|
|
13
16
|
var renderCategoryNavOther = (0, react_1.useCallback)(function (title, path) { return (react_1.default.createElement(CategoryNavOther_1.default, { apiUrl: apiUrl, navigate: navigate, title: title, path: path, children: CategoryNavOtherView })); }, [apiUrl, navigate, CategoryNavOtherView]);
|
|
14
17
|
var renderCategoryNavItem = (0, react_1.useCallback)(function (item) { return (react_1.default.createElement(CategoryNavItem_1.default, { key: item.id, apiUrl: apiUrl, navigate: navigate, category: item, children: CategoryNavItemView })); }, [apiUrl, navigate, CategoryNavItemView]);
|
|
15
18
|
return children({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HeaderProps, SignInButtonProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const Header: ({ to, pathname, navigate, children, SignInButtonView }: {
|
|
3
|
+
declare const Header: ({ to, backAction, pathname, navigate, children, SignInButtonView }: {
|
|
4
4
|
to?: string;
|
|
5
|
+
backAction?: () => void;
|
|
5
6
|
pathname: string;
|
|
6
7
|
navigate: (route: string) => void;
|
|
7
8
|
children: (props: HeaderProps) => ReactNode;
|
|
@@ -6,12 +6,16 @@ var hooks_1 = require("../app/hooks");
|
|
|
6
6
|
var slices_1 = require("../slices");
|
|
7
7
|
var SignInButton_1 = tslib_1.__importDefault(require("./SignInButton"));
|
|
8
8
|
var Header = function (_a) {
|
|
9
|
-
var to = _a.to, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
|
|
9
|
+
var to = _a.to, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
|
|
10
10
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
11
11
|
var header = ((0, hooks_1.useAppSelector)(slices_1.selectKioskConfig) || {}).header;
|
|
12
12
|
var back = function () {
|
|
13
|
-
if (
|
|
13
|
+
if (backAction) {
|
|
14
|
+
backAction();
|
|
15
|
+
}
|
|
16
|
+
else if (to) {
|
|
14
17
|
navigate(to);
|
|
18
|
+
}
|
|
15
19
|
};
|
|
16
20
|
var open = function () {
|
|
17
21
|
dispatch((0, slices_1.toggleSidebar)());
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
1
2
|
import React, { useCallback } from 'react';
|
|
2
3
|
import { useAppSelector } from '../app/hooks';
|
|
3
|
-
import { selectKioskConfig, selectMenu } from '../slices';
|
|
4
|
+
import { selectCustomerIdentified, selectKioskConfig, selectMenu } from '../slices';
|
|
4
5
|
import { default as CategoryNavItemContainer } from './CategoryNavItem';
|
|
5
6
|
import { default as CategoryNavOtherContainer } from './CategoryNavOther';
|
|
6
7
|
var CategoryNav = function (_a) {
|
|
7
8
|
var children = _a.children, navigate = _a.navigate, apiUrl = _a.apiUrl, CategoryNavOtherView = _a.CategoryNavOtherView, CategoryNavItemView = _a.CategoryNavItemView;
|
|
9
|
+
var customer = (useAppSelector(selectCustomerIdentified) || {}).customer;
|
|
8
10
|
var categoryNav = useAppSelector(selectKioskConfig).categoryNav;
|
|
9
|
-
var _b = useAppSelector(selectMenu), categories = _b.categories, featured = _b.featured,
|
|
11
|
+
var _b = useAppSelector(selectMenu), categories = _b.categories, featured = _b.featured, rest = __rest(_b, ["categories", "featured"]);
|
|
12
|
+
var favorites = customer ? rest.favorites : [];
|
|
13
|
+
var recents = customer ? rest.recents : [];
|
|
10
14
|
var renderCategoryNavOther = useCallback(function (title, path) { return (React.createElement(CategoryNavOtherContainer, { apiUrl: apiUrl, navigate: navigate, title: title, path: path, children: CategoryNavOtherView })); }, [apiUrl, navigate, CategoryNavOtherView]);
|
|
11
15
|
var renderCategoryNavItem = useCallback(function (item) { return (React.createElement(CategoryNavItemContainer, { key: item.id, apiUrl: apiUrl, navigate: navigate, category: item, children: CategoryNavItemView })); }, [apiUrl, navigate, CategoryNavItemView]);
|
|
12
16
|
return children({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HeaderProps, SignInButtonProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const Header: ({ to, pathname, navigate, children, SignInButtonView }: {
|
|
3
|
+
declare const Header: ({ to, backAction, pathname, navigate, children, SignInButtonView }: {
|
|
4
4
|
to?: string;
|
|
5
|
+
backAction?: () => void;
|
|
5
6
|
pathname: string;
|
|
6
7
|
navigate: (route: string) => void;
|
|
7
8
|
children: (props: HeaderProps) => ReactNode;
|
|
@@ -3,12 +3,16 @@ import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
|
3
3
|
import { selectKioskConfig, toggleSidebar } from '../slices';
|
|
4
4
|
import { default as SignInButtonContainer } from './SignInButton';
|
|
5
5
|
var Header = function (_a) {
|
|
6
|
-
var to = _a.to, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
|
|
6
|
+
var to = _a.to, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
|
|
7
7
|
var dispatch = useAppDispatch();
|
|
8
8
|
var header = (useAppSelector(selectKioskConfig) || {}).header;
|
|
9
9
|
var back = function () {
|
|
10
|
-
if (
|
|
10
|
+
if (backAction) {
|
|
11
|
+
backAction();
|
|
12
|
+
}
|
|
13
|
+
else if (to) {
|
|
11
14
|
navigate(to);
|
|
15
|
+
}
|
|
12
16
|
};
|
|
13
17
|
var open = function () {
|
|
14
18
|
dispatch(toggleSidebar());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.61",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|