-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathSuiteHeader.jsx
666 lines (649 loc) · 26.6 KB
/
SuiteHeader.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
/* eslint-disable jsx-a11y/anchor-is-valid */
/* eslint-disable no-script-url */
import React, { useState, useEffect, useCallback, useRef } from 'react';
import PropTypes from 'prop-types';
import { UserAvatar, Settings, Help } from '@carbon/react/icons';
import {
ButtonSkeleton,
HeaderContainer,
ActionableNotification,
Link,
SkeletonText,
} from '@carbon/react';
import classnames from 'classnames';
import { get, set, cloneDeep } from 'lodash-es';
import SideNav, { SideNavPropTypes } from '../SideNav/SideNav';
import Header from '../Header/Header';
import { HeaderActionItemPropTypes, ChildContentPropTypes } from '../Header/HeaderPropTypes';
import { settings } from '../../constants/Settings';
import Walkme from '../Walkme/Walkme';
import SuiteHeaderProfile from './SuiteHeaderProfile/SuiteHeaderProfile';
import SuiteHeaderAppSwitcher from './SuiteHeaderAppSwitcher/SuiteHeaderAppSwitcher';
import SuiteHeaderAppSwitcherLoading from './SuiteHeaderAppSwitcher/SuiteHeaderAppSwitcherLoading';
import MultiWorkspaceSuiteHeaderAppSwitcher from './SuiteHeaderAppSwitcher/MultiWorkspaceSuiteHeaderAppSwitcher';
import SuiteHeaderLogoutModal from './SuiteHeaderLogoutModal/SuiteHeaderLogoutModal';
import IdleLogoutConfirmationModal, {
IdleLogoutConfirmationModalIdleTimeoutPropTypes,
} from './IdleLogoutConfirmationModal/IdleLogoutConfirmationModal';
import SuiteHeaderI18N from './i18n';
import { shouldOpenInNewWindow } from './suiteHeaderUtils';
import {
SuiteHeaderApplicationPropTypes,
SuiteHeaderWorkspacePropTypes,
SuiteHeaderI18NPropTypes,
SuiteHeaderRoutePropTypes,
SuiteHeaderSurveyDataPropTypes,
} from './SuiteHeaderPropTypes';
import { SUITE_HEADER_ROUTE_TYPES } from './suiteHeaderConstants';
const defaultProps = {
className: null,
appName: null,
extraContent: null,
userDisplayName: null,
username: null,
isAdminView: false,
hasSideNav: false,
routes: null,
applications: null,
workspaces: null,
globalApplications: [],
sideNavProps: null,
surveyData: null,
idleTimeoutData: null,
onStayLoggedIn: () => {},
onSideNavToggled: async () => Promise.resolve(true),
onRouteChange: async () => Promise.resolve(true),
i18n: SuiteHeaderI18N.en,
customActionItems: [],
customHelpLinks: [],
customProfileLinks: [],
customApplications: [],
walkmePath: null,
walkmeLang: 'en',
testId: 'suite-header',
isActionItemVisible: () => true,
handleHeaderNameClick: null,
hideMenuButton: false,
closeSideNavOnNavigation: false,
};
const propTypes = {
/** Add class name to the rendered Header component */
className: PropTypes.string,
/** Name of suite (maps to appName in Header) */
suiteName: PropTypes.string.isRequired,
/** Application name in suite (maps to subtitle in Header) */
appName: PropTypes.string,
/** Extra content (a Tag, for example) */
extraContent: PropTypes.element,
/** Display name of current user */
userDisplayName: PropTypes.string,
/** Username of current user */
username: PropTypes.string,
/** If true, renders the admin button in Header as selected */
isAdminView: PropTypes.bool,
/** If true, will render the hamburger icon even if no sideNavProps are provided */
hasSideNav: PropTypes.bool,
/** URLs for various routes on Header buttons and submenus */
routes: PropTypes.shape(SuiteHeaderRoutePropTypes),
/** Applications to render in AppSwitcher (not used anymore, only kept here for backwards compatibility) */
applications: PropTypes.arrayOf(PropTypes.shape(SuiteHeaderApplicationPropTypes)),
/** Workspaces and applications to render in AppSwitcher */
workspaces: PropTypes.arrayOf(PropTypes.shape(SuiteHeaderWorkspacePropTypes)),
/** Applications that are not tied to workspaces */
globalApplications: PropTypes.arrayOf(PropTypes.shape(SuiteHeaderApplicationPropTypes)),
/** side navigation component */
sideNavProps: PropTypes.shape(SideNavPropTypes),
/** If surveyData is present, show an ActionableNotification */
surveyData: PropTypes.shape(SuiteHeaderSurveyDataPropTypes),
/** If idleTimeoutData is present, instantiate IdleLogoutConfirmationModal */
idleTimeoutData: PropTypes.shape(IdleLogoutConfirmationModalIdleTimeoutPropTypes),
/** Function called when idle timer is restarted */
onStayLoggedIn: PropTypes.func,
/** Function called when side nav button is toggled */
onSideNavToggled: PropTypes.func,
/** Function called before any route change. Returns a Promise<Boolean>. False means the redirect will not happen. This function should never throw an error. */
onRouteChange: PropTypes.func,
/** I18N strings */
i18n: PropTypes.shape(SuiteHeaderI18NPropTypes),
/** Array of custom header action items */
customActionItems: PropTypes.arrayOf(PropTypes.shape(HeaderActionItemPropTypes)),
/** Array of custom help menu links */
customHelpLinks: PropTypes.arrayOf(PropTypes.shape(ChildContentPropTypes)),
/** Array of custom profile menu links */
customProfileLinks: PropTypes.arrayOf(PropTypes.shape(ChildContentPropTypes)),
/** Array of custom applications */
customApplications: PropTypes.arrayOf(PropTypes.shape(SuiteHeaderApplicationPropTypes)),
/** Path to Walkme entry point */
walkmePath: PropTypes.string,
/** Walkme language code */
walkmeLang: PropTypes.string,
testId: PropTypes.string,
/** Optional callback when user clicks on header name */
handleHeaderNameClick: PropTypes.oneOfType([PropTypes.func, PropTypes.any]),
/** a function that will be passed the actionItem object and returns a boolean to determine if that item should be shown */
// eslint-disable-next-line react/forbid-foreign-prop-types
isActionItemVisible: Header.propTypes.isActionItemVisible,
/** Force menu button to hide regardless of side nav props */
hideMenuButton: PropTypes.bool,
/** Force side nav to close upon item click */
closeSideNavOnNavigation: PropTypes.bool,
};
const SuiteHeader = ({
className,
suiteName,
appName,
extraContent,
userDisplayName,
username,
hasSideNav,
isAdminView,
routes,
applications, // (not used anymore, only kept here for backwards compatibility)
workspaces,
globalApplications,
sideNavProps,
surveyData,
idleTimeoutData,
onStayLoggedIn,
onSideNavToggled,
onRouteChange,
i18n,
customActionItems,
customHelpLinks,
customProfileLinks,
customApplications,
walkmePath,
walkmeLang,
testId,
handleHeaderNameClick: handleHeaderNameClickProps,
hideMenuButton,
closeSideNavOnNavigation,
...otherHeaderProps
}) => {
const mergedI18N = { ...defaultProps.i18n, ...i18n };
const [showLogoutModal, setShowLogoutModal] = useState(false);
const [showToast, setShowToast] = useState(surveyData !== null && surveyData !== undefined);
const translate = useCallback(
(string, substitutions) =>
substitutions.reduce((acc, [key, val]) => acc.replace(key, val), string),
[]
);
const sideNavExpandedRef = useRef();
// Make sure that the survey toast notification is displayed if surveyData is passed in future rerenders
// not only at mount time
useEffect(() => {
if (surveyData !== null && surveyData !== undefined) {
setShowToast(true);
}
}, [surveyData]);
// Function to include close side nav functionality to items when they are clicked
const setOnClickDecorators = useCallback((sNavProps, onClickSideNavExpand) => {
const clickableItems = [];
const recursivelyGetClickableItems = (propValue, parentProp) => {
if (!parentProp) {
// Get links and recentLinks
Object.entries(propValue).forEach(([k, v]) => {
if (k === 'links' || k === 'recentLinks') {
recursivelyGetClickableItems(v, k);
}
});
} else if (Array.isArray(propValue)) {
// If the propValue is an array, check its items
propValue.forEach((i, idx) => recursivelyGetClickableItems(i, `${parentProp}[${idx}]`));
} else if ((propValue?.childContent ?? []).length > 0) {
// If the propValue contains childContent, check each one of them
recursivelyGetClickableItems(propValue.childContent, `${parentProp}.childContent`);
} else if (propValue?.metaData) {
// If propValue doesn't contain children and it has metaData, add it to the clickableItems array
clickableItems.push(`${parentProp}.metaData`);
}
};
recursivelyGetClickableItems(sNavProps);
// Clone side nav props object
const cloned = cloneDeep(sNavProps);
clickableItems.forEach((i) => {
const item = get(cloned, i);
// Change onClick function to add onClickSideNavExpand call
set(cloned, i, {
...item,
onClick: (...args) => {
if (item.onClick) {
item.onClick(...args);
}
if (sideNavExpandedRef.current) {
// Only allow toggling off the side nav expanded state
onClickSideNavExpand(...args);
}
},
});
});
return cloned;
}, []);
const isMultiWorkspace = workspaces?.length > 0;
const currentWorkspace = workspaces?.find((wo) => wo.isCurrent);
const appId =
currentWorkspace?.applications?.find((a) => a.isCurrent)?.id ??
applications?.find((a) => a.isCurrent)?.id;
// Include the current workspace label only if we are not in an admin page and multi workspace is supported and more than one workspace is available
const currentWorkspaceComponent =
!isAdminView && isMultiWorkspace && workspaces?.length > 1 && currentWorkspace ? (
<span data-testid={`${testId}--current-workspace`}>{currentWorkspace.name}</span>
) : null;
const appNameComponent = appName ? (
<span
data-testid={`${testId}--appName`}
className={classnames({
[`${settings.iotPrefix}--suite-header-subtitle-appname`]: !!currentWorkspaceComponent,
})}
>
{appName}
</span>
) : null;
const extraContentComponent = extraContent ? (
<span className={`${settings.iotPrefix}--suite-header-subtitle`}>{extraContent}</span>
) : null;
const navigatorRoute = currentWorkspace?.href || routes?.navigator || 'javascript:void(0)';
const adminRoute = routes?.admin || 'javascript:void(0)';
// Append originHref query parameter (and, optionally, originIsAdmin, originWorkspaceId and originAppId) to the logout route
let logoutRoute = routes?.logout;
try {
const url = new URL(routes.logout);
if (window.location.href) {
url.searchParams.append(
'originHref',
[window.location.protocol, '//', window.location.host, window.location.pathname].join('')
);
}
if (appId) {
url.searchParams.append('originAppId', appId);
}
if (currentWorkspace?.id) {
url.searchParams.append('originWorkspaceId', currentWorkspace.id);
}
if (isAdminView) {
url.searchParams.append('originIsAdmin', isAdminView);
}
logoutRoute = url.href;
} catch (e) {
logoutRoute = routes?.logout;
}
// If there are custom help links, include an extra child content entry for the separator
const mergedCustomHelpLinks =
customHelpLinks.length > 0
? [
...customHelpLinks,
{
metaData: {
className: `${settings.iotPrefix}--suite-header-help--separator`,
element: 'div',
},
content: '',
},
]
: [];
const handleOnClick = (routeType, href, isExternal) => async (e) => {
e.preventDefault();
const newWindow = isExternal ? true : shouldOpenInNewWindow(e);
const result = await onRouteChange(routeType, href);
if (result) {
if (newWindow) {
window.open(href, '_blank', 'noopener noreferrer');
} else {
window.location.href = href;
}
}
};
const handleHeaderNameClick = useCallback(
(evt) => {
if (handleHeaderNameClickProps) {
handleHeaderNameClickProps(evt, navigatorRoute);
}
},
[handleHeaderNameClickProps, navigatorRoute]
);
return (
<>
{walkmePath ? <Walkme path={walkmePath} lang={walkmeLang} /> : null}
{showToast && surveyData ? (
<ActionableNotification
data-testid={`${testId}-notification`}
className={`${settings.iotPrefix}--suite-header-survey-toast`}
kind="info"
title={
typeof mergedI18N.surveyTitle === 'function'
? mergedI18N.surveyTitle(appName || suiteName)
: translate(mergedI18N.surveyTitle, [['{solutionName}', appName || suiteName]])
}
lowContrast
caption=""
onCloseButtonClick={() => setShowToast(false)}
>
<Link
href={surveyData.surveyLink}
rel="noopener noreferrer"
onClick={handleOnClick(SUITE_HEADER_ROUTE_TYPES.SURVEY, surveyData.surveyLink, true)}
>
{mergedI18N.surveyText}
</Link>
<div className={`${settings.iotPrefix}--suite-header-survey-policy-link`}>
<Link
href={surveyData.privacyLink}
rel="noopener noreferrer"
onClick={handleOnClick(SUITE_HEADER_ROUTE_TYPES.SURVEY, surveyData.privacyLink, true)}
>
{mergedI18N.surveyPrivacyPolicy}
</Link>
</div>
</ActionableNotification>
) : null}
{idleTimeoutData && routes?.domain !== null && routes?.domain !== undefined ? (
<IdleLogoutConfirmationModal
isAdminView={isAdminView}
appId={appId}
workspaceId={currentWorkspace?.id}
idleTimeoutData={idleTimeoutData}
routes={routes}
onRouteChange={onRouteChange}
onStayLoggedIn={onStayLoggedIn}
i18n={i18n}
/>
) : null}
<SuiteHeaderLogoutModal
isOpen={showLogoutModal}
onClose={() => setShowLogoutModal(false)}
onLogout={handleOnClick(SUITE_HEADER_ROUTE_TYPES.LOGOUT, logoutRoute)}
i18n={{
heading: mergedI18N.profileLogoutModalHeading,
primaryButton: mergedI18N.profileLogoutModalPrimaryButton,
secondaryButton: mergedI18N.profileLogoutModalSecondaryButton,
body:
typeof mergedI18N.profileLogoutModalBody === 'function'
? mergedI18N.profileLogoutModalBody(appName || suiteName, userDisplayName)
: translate(mergedI18N.profileLogoutModalBody, [
['{solutionName}', appName || suiteName],
['{userName}', userDisplayName],
]),
}}
testId={`${testId}-logout-modal`}
/>
{routes && (
<>
<span className={`${settings.iotPrefix}--suite-header-data`} data-type="workspaceId">
{routes.workspaceId}
</span>
<span className={`${settings.iotPrefix}--suite-header-data`} data-type="domain">
{routes.domain}
</span>
</>
)}
<HeaderContainer
render={({ isSideNavExpanded, onClickSideNavExpand }) => {
sideNavExpandedRef.current = isSideNavExpanded;
return (
<>
<Header
testId={testId}
className={classnames(`${settings.iotPrefix}--suite-header`, className)}
url={navigatorRoute}
handleHeaderNameClick={handleHeaderNameClick}
hasSideNav={hideMenuButton ? false : hasSideNav || sideNavProps !== null}
onClickSideNavExpand={(evt) => {
onSideNavToggled(evt);
onClickSideNavExpand(evt);
}}
headerPanel={{
className: `${settings.iotPrefix}--suite-header-app-switcher${
workspaces ? '-multiworkspace' : ''
}`,
// eslint-disable-next-line react/prop-types
content: React.forwardRef(({ isExpanded }, ref) =>
workspaces ? (
<MultiWorkspaceSuiteHeaderAppSwitcher
ref={ref}
isAdminView={isAdminView}
workspaces={workspaces}
globalApplications={globalApplications}
customApplications={customApplications}
adminLink={routes?.admin}
noAccessLink={routes?.gettingStarted || 'javascript:void(0)'}
onRouteChange={onRouteChange}
i18n={{
workspace: mergedI18N.switcherWorkspace,
workspaces: mergedI18N.switcherWorkspaces,
workspaceAdmin: mergedI18N.switcherWorkspaceAdmin,
backToAppSwitcher: mergedI18N.switcherBackToAppSwitcher,
selectWorkspace: mergedI18N.switcherSelectWorkspace,
availableWorkspaces: mergedI18N.switcherAvailableWorkspaces,
suiteAdmin: mergedI18N.switcherSuiteAdmin,
global: mergedI18N.switcherGlobal,
myApplications: mergedI18N.switcherMyApplications,
allApplicationsLink: mergedI18N.switcherNavigatorLink,
requestAccess: mergedI18N.switcherRequestAccess,
learnMoreLink: mergedI18N.switcherLearnMoreLink,
}}
testId={`${testId}-app-switcher`}
isExpanded={isExpanded}
/>
) : applications ? (
<SuiteHeaderAppSwitcher
ref={ref}
applications={applications}
customApplications={customApplications}
allApplicationsLink={routes?.navigator}
noAccessLink={routes?.gettingStarted || 'javascript:void(0)'}
onRouteChange={onRouteChange}
i18n={{
myApplications: mergedI18N.switcherMyApplications,
allApplicationsLink: mergedI18N.switcherNavigatorLink,
requestAccess: mergedI18N.switcherRequestAccess,
learnMoreLink: mergedI18N.switcherLearnMoreLink,
}}
testId={`${testId}-app-switcher`}
isExpanded={isExpanded}
/>
) : (
<SuiteHeaderAppSwitcherLoading ref={ref} testId={`${testId}-app-switcher`} />
)
),
}}
appName={suiteName}
subtitle={
appNameComponent || currentWorkspaceComponent || extraContentComponent ? (
<div dir="auto">
{currentWorkspaceComponent}
{appNameComponent}
{extraContentComponent}
</div>
) : null
}
actionItems={[
...customActionItems,
{
id: 'admin',
label: mergedI18N.administrationIcon,
className: [
'admin-icon',
!routes?.admin ? 'admin-icon__hidden' : null,
isAdminView ? 'admin-icon__selected' : null,
]
.filter((i) => i)
.join(' '),
btnContent: (
<span id="suite-header-action-item-admin">
<Settings
size="20"
fill="white"
data-testid="admin-icon"
description={mergedI18N.settingsIcon}
/>
</span>
),
onClick: async (e) => {
e.preventDefault();
let href = adminRoute;
let routeType = SUITE_HEADER_ROUTE_TYPES.ADMIN;
if (isAdminView) {
href = navigatorRoute;
routeType = SUITE_HEADER_ROUTE_TYPES.NAVIGATOR;
}
handleOnClick(routeType, href)(e);
},
href: isAdminView ? navigatorRoute : adminRoute,
},
{
id: 'help',
label: mergedI18N.help,
onClick: () => {},
btnContent: (
<span id="suite-header-action-item-help">
<Help size="20" fill="white" description={mergedI18N.help} />
</span>
),
childContent: routes
? [
...mergedCustomHelpLinks,
...[
'whatsNew',
'gettingStarted',
'documentation',
'requestEnhancement',
'support',
].map((item) => ({
metaData: {
element: 'a',
'data-testid': `suite-header-help--${item}`,
href: routes[item],
rel: 'noopener noreferrer',
title: mergedI18N[item],
onClick: handleOnClick(
SUITE_HEADER_ROUTE_TYPES.DOCUMENTATION,
routes[item],
true
),
},
content: (
<span id={`suite-header-help-menu-${item}`}>{mergedI18N[item]}</span>
),
})),
{
metaData: {
element: 'a',
'data-testid': 'suite-header-help--about',
href: routes.about,
rel: 'noopener noreferrer',
title: mergedI18N.about,
onClick: handleOnClick(SUITE_HEADER_ROUTE_TYPES.ABOUT, routes.about),
},
content: (
<span id="suite-header-help-menu-about">{mergedI18N.about}</span>
),
},
]
: [
{
metaData: {
element: 'div',
},
content: (
<div
className={`${settings.iotPrefix}--suite-header-help--loading`}
data-testid="suite-header-help--loading"
>
<SkeletonText paragraph lineCount={6} />
</div>
),
},
],
},
{
id: 'user',
label: 'user',
btnContent: (
<span id="suite-header-action-item-profile">
<UserAvatar
size="20"
data-testid="user-icon"
fill="white"
description={mergedI18N.userIcon}
/>
</span>
),
childContent: [
{
metaData: {
element: 'div',
},
content: (
<span id="suite-header-profile-menu-profile" style={{ width: '100%' }}>
<SuiteHeaderProfile
displayName={userDisplayName}
username={username}
profileLink={routes?.profile}
onProfileClick={handleOnClick(
SUITE_HEADER_ROUTE_TYPES.PROFILE,
routes?.profile
)}
i18n={{
profileTitle: mergedI18N.profileTitle,
profileButton: mergedI18N.profileManageButton,
}}
testId={`${testId}-profile`}
/>
</span>
),
},
...customProfileLinks,
username
? {
metaData: {
className: `${settings.iotPrefix}--suite-header--logout`,
element: 'a',
'data-testid': 'suite-header-profile--logout',
href: 'javascript:void(0)',
title: mergedI18N.logout,
onClick: () => setShowLogoutModal(true),
},
content: (
<span id="suite-header-profile-menu-logout">{mergedI18N.logout}</span>
),
}
: {
metaData: {
element: 'div',
},
content: (
<div
className={`${settings.iotPrefix}--suite-header--logout--loading`}
data-testid="suite-header--logout--loading"
>
<ButtonSkeleton />
</div>
),
},
],
},
].filter((i) => i)}
showCloseIconWhenPanelExpanded
isSideNavExpanded={isSideNavExpanded}
{...otherHeaderProps}
/>
{sideNavProps ? (
<SideNav
{...(closeSideNavOnNavigation
? setOnClickDecorators(sideNavProps, onClickSideNavExpand)
: sideNavProps)}
isSideNavExpanded={isSideNavExpanded}
testId={`${testId}-side-nav`}
/>
) : null}
</>
);
}}
/>
</>
);
};
SuiteHeader.defaultProps = defaultProps;
SuiteHeader.propTypes = propTypes;
SuiteHeader.ROUTE_TYPES = SUITE_HEADER_ROUTE_TYPES;
export default SuiteHeader;