@open-tender/store 1.1.197 → 1.1.199
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,6 +1,6 @@
|
|
|
1
|
-
import { HeaderProps, SignInButtonProps } from '@open-tender/ui';
|
|
1
|
+
import { HeaderProps, SignInButtonProps, TagsButtonProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const Header: ({ to, backText, backAction, pathname, navigate, children, SignInButtonView }: {
|
|
3
|
+
declare const Header: ({ to, backText, backAction, pathname, navigate, children, SignInButtonView, TagsButtonView }: {
|
|
4
4
|
to?: string;
|
|
5
5
|
backText?: string;
|
|
6
6
|
backAction?: () => void;
|
|
@@ -8,5 +8,6 @@ declare const Header: ({ to, backText, backAction, pathname, navigate, children,
|
|
|
8
8
|
navigate: (route: string) => void;
|
|
9
9
|
children: (props: HeaderProps) => ReactNode;
|
|
10
10
|
SignInButtonView: (props: SignInButtonProps) => ReactNode;
|
|
11
|
+
TagsButtonView: (props: TagsButtonProps) => ReactNode;
|
|
11
12
|
}) => React.ReactNode;
|
|
12
13
|
export default Header;
|
|
@@ -5,8 +5,9 @@ var react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
var hooks_1 = require("../app/hooks");
|
|
6
6
|
var slices_1 = require("../slices");
|
|
7
7
|
var SignInButton_1 = tslib_1.__importDefault(require("./SignInButton"));
|
|
8
|
+
var TagsButton_1 = tslib_1.__importDefault(require("./TagsButton"));
|
|
8
9
|
var Header = function (_a) {
|
|
9
|
-
var to = _a.to, _b = _a.backText, backText = _b === void 0 ? 'Back' : _b, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
|
|
10
|
+
var to = _a.to, _b = _a.backText, backText = _b === void 0 ? 'Back' : _b, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView, TagsButtonView = _a.TagsButtonView;
|
|
10
11
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
11
12
|
var config = ((0, hooks_1.useAppSelector)(slices_1.selectKioskConfig) || {}).header;
|
|
12
13
|
var showButtons = !!(backAction || to);
|
|
@@ -28,6 +29,7 @@ var Header = function (_a) {
|
|
|
28
29
|
};
|
|
29
30
|
var handlers = { back: back, open: open, startOver: startOver };
|
|
30
31
|
var renderSignInButton = (0, react_1.useCallback)(function () { return (react_1.default.createElement(SignInButton_1.default, { pathname: pathname, navigate: navigate, children: SignInButtonView })); }, [pathname, navigate, SignInButtonView]);
|
|
32
|
+
var renderTagsButton = (0, react_1.useCallback)(function () { return react_1.default.createElement(TagsButton_1.default, { children: TagsButtonView }); }, [TagsButtonView]);
|
|
31
33
|
if (!config)
|
|
32
34
|
return null;
|
|
33
35
|
return children({
|
|
@@ -35,7 +37,8 @@ var Header = function (_a) {
|
|
|
35
37
|
handlers: handlers,
|
|
36
38
|
showButtons: showButtons,
|
|
37
39
|
backText: backText,
|
|
38
|
-
renderSignInButton: display_sign_in ? renderSignInButton : undefined
|
|
40
|
+
renderSignInButton: display_sign_in ? renderSignInButton : undefined,
|
|
41
|
+
renderTagsButton: renderTagsButton
|
|
39
42
|
});
|
|
40
43
|
};
|
|
41
44
|
exports.default = Header;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HeaderProps, SignInButtonProps } from '@open-tender/ui';
|
|
1
|
+
import { HeaderProps, SignInButtonProps, TagsButtonProps } from '@open-tender/ui';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const Header: ({ to, backText, backAction, pathname, navigate, children, SignInButtonView }: {
|
|
3
|
+
declare const Header: ({ to, backText, backAction, pathname, navigate, children, SignInButtonView, TagsButtonView }: {
|
|
4
4
|
to?: string;
|
|
5
5
|
backText?: string;
|
|
6
6
|
backAction?: () => void;
|
|
@@ -8,5 +8,6 @@ declare const Header: ({ to, backText, backAction, pathname, navigate, children,
|
|
|
8
8
|
navigate: (route: string) => void;
|
|
9
9
|
children: (props: HeaderProps) => ReactNode;
|
|
10
10
|
SignInButtonView: (props: SignInButtonProps) => ReactNode;
|
|
11
|
+
TagsButtonView: (props: TagsButtonProps) => ReactNode;
|
|
11
12
|
}) => React.ReactNode;
|
|
12
13
|
export default Header;
|
|
@@ -2,8 +2,9 @@ import React, { useCallback } from 'react';
|
|
|
2
2
|
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
3
|
import { selectKioskConfig, selectStoreSettings, toggleSidebar } from '../slices';
|
|
4
4
|
import { default as SignInButtonContainer } from './SignInButton';
|
|
5
|
+
import { default as TagsButtonContainer } from './TagsButton';
|
|
5
6
|
var Header = function (_a) {
|
|
6
|
-
var to = _a.to, _b = _a.backText, backText = _b === void 0 ? 'Back' : _b, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView;
|
|
7
|
+
var to = _a.to, _b = _a.backText, backText = _b === void 0 ? 'Back' : _b, backAction = _a.backAction, pathname = _a.pathname, navigate = _a.navigate, children = _a.children, SignInButtonView = _a.SignInButtonView, TagsButtonView = _a.TagsButtonView;
|
|
7
8
|
var dispatch = useAppDispatch();
|
|
8
9
|
var config = (useAppSelector(selectKioskConfig) || {}).header;
|
|
9
10
|
var showButtons = !!(backAction || to);
|
|
@@ -25,6 +26,7 @@ var Header = function (_a) {
|
|
|
25
26
|
};
|
|
26
27
|
var handlers = { back: back, open: open, startOver: startOver };
|
|
27
28
|
var renderSignInButton = useCallback(function () { return (React.createElement(SignInButtonContainer, { pathname: pathname, navigate: navigate, children: SignInButtonView })); }, [pathname, navigate, SignInButtonView]);
|
|
29
|
+
var renderTagsButton = useCallback(function () { return React.createElement(TagsButtonContainer, { children: TagsButtonView }); }, [TagsButtonView]);
|
|
28
30
|
if (!config)
|
|
29
31
|
return null;
|
|
30
32
|
return children({
|
|
@@ -32,7 +34,8 @@ var Header = function (_a) {
|
|
|
32
34
|
handlers: handlers,
|
|
33
35
|
showButtons: showButtons,
|
|
34
36
|
backText: backText,
|
|
35
|
-
renderSignInButton: display_sign_in ? renderSignInButton : undefined
|
|
37
|
+
renderSignInButton: display_sign_in ? renderSignInButton : undefined,
|
|
38
|
+
renderTagsButton: renderTagsButton
|
|
36
39
|
});
|
|
37
40
|
};
|
|
38
41
|
export default Header;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.199",
|
|
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",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@emotion/react": "^11.11.1",
|
|
64
|
-
"@open-tender/types": "^0.4.
|
|
65
|
-
"@open-tender/ui": "^0.4.
|
|
64
|
+
"@open-tender/types": "^0.4.82",
|
|
65
|
+
"@open-tender/ui": "^0.4.15",
|
|
66
66
|
"@open-tender/utils": "^0.4.61",
|
|
67
67
|
"@reduxjs/toolkit": "^2.0.1",
|
|
68
68
|
"date-fns": "2.30.0",
|