@headless-adminapp/fluent 0.0.17-alpha.32 → 0.0.17-alpha.34
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.
|
@@ -6,6 +6,7 @@ const react_components_1 = require("@fluentui/react-components");
|
|
|
6
6
|
const react_nav_preview_1 = require("@fluentui/react-nav-preview");
|
|
7
7
|
const app_1 = require("@headless-adminapp/app/app");
|
|
8
8
|
const hooks_1 = require("@headless-adminapp/app/auth/hooks");
|
|
9
|
+
const useIsSkipAuthCheck_1 = require("@headless-adminapp/app/auth/hooks/useIsSkipAuthCheck");
|
|
9
10
|
const hooks_2 = require("@headless-adminapp/app/hooks");
|
|
10
11
|
const locale_1 = require("@headless-adminapp/app/locale");
|
|
11
12
|
const icons_1 = require("@headless-adminapp/icons");
|
|
@@ -14,9 +15,10 @@ const AppLogo_1 = require("./AppLogo");
|
|
|
14
15
|
const AppStringContext_1 = require("./AppStringContext");
|
|
15
16
|
const QuickActionItem_1 = require("./QuickActionItem");
|
|
16
17
|
const AppHeaderContainer = ({ onNavToggle, }) => {
|
|
17
|
-
var _a, _b;
|
|
18
|
+
var _a, _b, _c;
|
|
18
19
|
const { app } = (0, app_1.useAppContext)();
|
|
19
20
|
const authSession = (0, hooks_1.useAuthSession)();
|
|
21
|
+
const isSkipAuthCheck = (0, useIsSkipAuthCheck_1.useIsSkipAuthCheck)();
|
|
20
22
|
const logout = (0, hooks_1.useLogout)();
|
|
21
23
|
const strings = (0, AppStringContext_1.useAppStrings)();
|
|
22
24
|
const { language } = (0, locale_1.useLocale)();
|
|
@@ -46,9 +48,9 @@ const AppHeaderContainer = ({ onNavToggle, }) => {
|
|
|
46
48
|
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', gap: 8 }, children: (_a = app.quickActionItems) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
|
|
47
49
|
var _a, _b;
|
|
48
50
|
return ((0, jsx_runtime_1.jsx)(QuickActionItem_1.QuickActionItem, { Icon: item.icon, label: (_b = (_a = item.localizedLabel) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : item.label, onClick: () => { var _a; return (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item); }, link: item.link }, index));
|
|
49
|
-
}) }), (0, jsx_runtime_1.jsxs)(react_components_1.Popover, { children: [(0, jsx_runtime_1.jsx)(react_components_1.PopoverTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.Avatar, { initials: initials, color: "neutral", style: { cursor: 'pointer' }, image: {
|
|
51
|
+
}) }), (!isSkipAuthCheck || !!((_b = app.accountMenuItems) === null || _b === void 0 ? void 0 : _b.length)) && ((0, jsx_runtime_1.jsxs)(react_components_1.Popover, { children: [(0, jsx_runtime_1.jsx)(react_components_1.PopoverTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.Avatar, { initials: initials, color: "neutral", style: { cursor: 'pointer' }, image: {
|
|
50
52
|
src: authSession === null || authSession === void 0 ? void 0 : authSession.profilePicture,
|
|
51
|
-
} }) }), (0, jsx_runtime_1.jsxs)(react_components_1.PopoverSurface, { tabIndex: -1, style: { padding: 0 }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
53
|
+
} }) }), (0, jsx_runtime_1.jsxs)(react_components_1.PopoverSurface, { tabIndex: -1, style: { padding: 0 }, children: [!isSkipAuthCheck && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
52
54
|
display: 'flex',
|
|
53
55
|
gap: 8,
|
|
54
56
|
padding: 8,
|
|
@@ -61,10 +63,10 @@ const AppHeaderContainer = ({ onNavToggle, }) => {
|
|
|
61
63
|
flexDirection: 'column',
|
|
62
64
|
overflow: 'hidden',
|
|
63
65
|
flex: 1,
|
|
64
|
-
}, children: [(0, jsx_runtime_1.jsx)(react_components_1.Caption1Strong, { children: authSession === null || authSession === void 0 ? void 0 : authSession.fullName }), (0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { textOverflow: 'ellipsis', overflow: 'hidden' }, children: authSession === null || authSession === void 0 ? void 0 : authSession.email })] })] }), (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, { style: { marginInline: 0 } }), (0, jsx_runtime_1.jsxs)(react_components_1.MenuList, { style: { width: 200, marginBottom: 4 }, children: [(
|
|
66
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_components_1.Caption1Strong, { children: authSession === null || authSession === void 0 ? void 0 : authSession.fullName }), (0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { textOverflow: 'ellipsis', overflow: 'hidden' }, children: authSession === null || authSession === void 0 ? void 0 : authSession.email })] })] })), !isSkipAuthCheck && (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, { style: { marginInline: 0 } }), (0, jsx_runtime_1.jsxs)(react_components_1.MenuList, { style: { width: 200, marginBottom: 4 }, children: [(_c = app.accountMenuItems) === null || _c === void 0 ? void 0 : _c.map((item, index) => {
|
|
65
67
|
var _a, _b;
|
|
66
68
|
const Icon = item.icon;
|
|
67
69
|
return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: "inherit" }), onClick: () => { var _a; return (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item); }, children: (_b = (_a = item.localizedLabel) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : item.label }, index));
|
|
68
|
-
}), (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.SignOut, {}), onClick: () => logout(), children: strings.logout })] })] })] })] })] }));
|
|
70
|
+
}), !isSkipAuthCheck && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.SignOut, {}), onClick: () => logout(), children: strings.logout }))] })] })] }))] })] }));
|
|
69
71
|
};
|
|
70
72
|
exports.AppHeaderContainer = AppHeaderContainer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "0.0.17-alpha.
|
|
3
|
+
"version": "0.0.17-alpha.34",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"uuid": "11.0.3",
|
|
48
48
|
"yup": "^1.4.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "4c3efe1f179c2b530941c0cf0817130173634330"
|
|
51
51
|
}
|