ui-soxo-bootstrap-core 2.6.1-dev.27 → 2.6.1-dev.28
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/core/lib/Store.js
CHANGED
|
@@ -72,12 +72,16 @@ const initialTheme = () => {
|
|
|
72
72
|
const initialState = {
|
|
73
73
|
defaultBranch: {},
|
|
74
74
|
theme: initialTheme(), // Set the initial theme from themes.json
|
|
75
|
+
settings: {},
|
|
75
76
|
};
|
|
76
77
|
|
|
77
78
|
/**
|
|
78
79
|
* Context for sharing state accross app
|
|
79
80
|
*/
|
|
80
|
-
export const GlobalContext = createContext(
|
|
81
|
+
export const GlobalContext = createContext({
|
|
82
|
+
...initialState,
|
|
83
|
+
state: initialState,
|
|
84
|
+
});
|
|
81
85
|
|
|
82
86
|
let app = {};
|
|
83
87
|
|
|
@@ -9,7 +9,7 @@ import { animationControls, motion, useAnimation } from 'framer-motion';
|
|
|
9
9
|
|
|
10
10
|
import { boxVariants } from './animations';
|
|
11
11
|
|
|
12
|
-
import { GlobalContext } from
|
|
12
|
+
import { GlobalContext, GlobalProvider } from "./../../Store";
|
|
13
13
|
|
|
14
14
|
import { Link, useLocation } from 'react-router-dom';
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ import { Button } from '../../elements';
|
|
|
21
21
|
|
|
22
22
|
import GenericHeader from '../header/generic-header';
|
|
23
23
|
|
|
24
|
-
import { MenuOutlined, UserOutlined, SettingOutlined,
|
|
24
|
+
import { MenuOutlined, UserOutlined, SettingOutlined, QuestionOutlined } from '@ant-design/icons';
|
|
25
25
|
|
|
26
26
|
import { Drawer } from 'antd';
|
|
27
27
|
|
|
@@ -43,7 +43,8 @@ import { LicenseAlert } from '../../../components';
|
|
|
43
43
|
|
|
44
44
|
const { Title } = Typography;
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
function GlobalHeaderContent({
|
|
47
48
|
loading,
|
|
48
49
|
appSettings,
|
|
49
50
|
children,
|
|
@@ -60,9 +61,12 @@ export default function GlobalHeader({
|
|
|
60
61
|
let location = useLocation();
|
|
61
62
|
// let location = {};
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
const { isMobile, user = { locations: [] }, kiosk, state, settings } = useContext(GlobalContext);
|
|
64
67
|
|
|
65
68
|
const [visible, setVisible] = useState(false);
|
|
69
|
+
const helpDeskSetting = settings?.HELPATR || {}
|
|
66
70
|
|
|
67
71
|
// Variable to handle toggling of menu
|
|
68
72
|
const [collapsed, setCollapsed] = useState(false);
|
|
@@ -74,8 +78,6 @@ export default function GlobalHeader({
|
|
|
74
78
|
|
|
75
79
|
const { t, i18n } = useTranslation();
|
|
76
80
|
|
|
77
|
-
const helpDeskUrl = process.env.REACT_APP_HELP_DESK_URL
|
|
78
|
-
|
|
79
81
|
const spotlightRef = useRef();
|
|
80
82
|
|
|
81
83
|
useEffect(() => {
|
|
@@ -135,6 +137,15 @@ export default function GlobalHeader({
|
|
|
135
137
|
animate();
|
|
136
138
|
}, []);
|
|
137
139
|
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
|
|
142
|
+
}, [state.theme]);
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
138
149
|
useEffect(() => { }, [state.theme]);
|
|
139
150
|
|
|
140
151
|
return (
|
|
@@ -283,11 +294,11 @@ export default function GlobalHeader({
|
|
|
283
294
|
{/* Reload Button Ends */}
|
|
284
295
|
|
|
285
296
|
{/* Help-desk-btn */}
|
|
286
|
-
{
|
|
297
|
+
{helpDeskSetting?.showSupportBtn ? <Tooltip title={helpDeskSetting?.toolTipText}>
|
|
287
298
|
<span>
|
|
288
299
|
<Button
|
|
289
|
-
onClick={() => window.open(
|
|
290
|
-
icon={<
|
|
300
|
+
onClick={() => window.open(helpDeskSetting?.helpDeskLink ?? '', '_blank')}
|
|
301
|
+
icon={<QuestionOutlined />}
|
|
291
302
|
type="default"
|
|
292
303
|
size="small"
|
|
293
304
|
/>
|
|
@@ -335,6 +346,23 @@ export default function GlobalHeader({
|
|
|
335
346
|
);
|
|
336
347
|
}
|
|
337
348
|
|
|
349
|
+
|
|
350
|
+
export default function GlobalHeader(props) {
|
|
351
|
+
const context = useContext(GlobalContext);
|
|
352
|
+
|
|
353
|
+
if (context.dispatch) {
|
|
354
|
+
return <GlobalHeaderContent {...props} />;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return (
|
|
358
|
+
<GlobalProvider {...props} appSettings={props.appSettings}>
|
|
359
|
+
<GlobalHeaderContent {...props} />
|
|
360
|
+
</GlobalProvider>
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
338
366
|
/**
|
|
339
367
|
*
|
|
340
368
|
* @returns
|