@boomerang-io/carbon-addons-boomerang-react 4.6.21-beta.3 → 4.6.21-beta.4
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.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var reactRouterDom = require('react-router-dom');
|
|
6
7
|
var cx = require('classnames');
|
|
7
8
|
var react = require('@carbon/react');
|
|
8
9
|
var TooltipHover = require('../TooltipHover/TooltipHover.js');
|
|
@@ -37,6 +38,7 @@ function AdvantageSideNav(props) {
|
|
|
37
38
|
const [activeMenu, setActiveMenu] = React__default.default.useState(false);
|
|
38
39
|
const isMenuOpen = isOpen || activeMenu;
|
|
39
40
|
const windowLocation = window.location;
|
|
41
|
+
const location = reactRouterDom.useLocation();
|
|
40
42
|
const isPartnerUser = user?.type === UserType.USER_PLATFORM_ROLE.Partner;
|
|
41
43
|
const joinButtontitle = showSelectTeamPurpose ? "Create Team" : "Create or Join Team";
|
|
42
44
|
const hamburguerMenu = document.getElementById("header-sidenav-menu-button");
|
|
@@ -228,9 +230,18 @@ function AdvantageSideNav(props) {
|
|
|
228
230
|
handleDocumentCollectionsClick();
|
|
229
231
|
} }, "Document Collections")) : null,
|
|
230
232
|
showSecondDivider ? React__default.default.createElement(react.SideNavDivider, null) : null,
|
|
231
|
-
catalogNavlink ? (React__default.default.createElement(
|
|
232
|
-
|
|
233
|
-
|
|
233
|
+
catalogNavlink ? (React__default.default.createElement(reactRouterDom.Link, { to: catalogNavlink, style: { textDecoration: "none" } },
|
|
234
|
+
React__default.default.createElement(react.SideNavLink, { "data-testid": "sidenav-catalog-link", isActive: location.pathname.includes("/catalog"), renderIcon: icons.Catalog }, "Catalog"))
|
|
235
|
+
// <SideNavLink
|
|
236
|
+
// to={catalogNavlink}
|
|
237
|
+
// data-testid="sidenav-catalog-link"
|
|
238
|
+
// isActive={windowLocation.href.includes(`${baseEnvUrl}/catalog`)}
|
|
239
|
+
// // href={catalogNavlink}
|
|
240
|
+
// renderIcon={Catalog}
|
|
241
|
+
// >
|
|
242
|
+
// Catalog
|
|
243
|
+
// </SideNavLink>
|
|
244
|
+
) : null,
|
|
234
245
|
settingsLink ? (React__default.default.createElement(react.SideNavLink, { "data-testid": "sidenav-settings-link", renderIcon: icons.Settings, href: settingsLink, onClick: (e) => {
|
|
235
246
|
handleSettingsClick();
|
|
236
247
|
} }, "Settings")) : null,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useLocation, Link } from 'react-router-dom';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import { SideNavLink, SideNav, SideNavItems, SideNavDivider, Tag } from '@carbon/react';
|
|
4
5
|
import TooltipHover from '../TooltipHover/TooltipHover.js';
|
|
@@ -28,6 +29,7 @@ function AdvantageSideNav(props) {
|
|
|
28
29
|
const [activeMenu, setActiveMenu] = React.useState(false);
|
|
29
30
|
const isMenuOpen = isOpen || activeMenu;
|
|
30
31
|
const windowLocation = window.location;
|
|
32
|
+
const location = useLocation();
|
|
31
33
|
const isPartnerUser = user?.type === USER_PLATFORM_ROLE.Partner;
|
|
32
34
|
const joinButtontitle = showSelectTeamPurpose ? "Create Team" : "Create or Join Team";
|
|
33
35
|
const hamburguerMenu = document.getElementById("header-sidenav-menu-button");
|
|
@@ -219,9 +221,18 @@ function AdvantageSideNav(props) {
|
|
|
219
221
|
handleDocumentCollectionsClick();
|
|
220
222
|
} }, "Document Collections")) : null,
|
|
221
223
|
showSecondDivider ? React.createElement(SideNavDivider, null) : null,
|
|
222
|
-
catalogNavlink ? (React.createElement(
|
|
223
|
-
|
|
224
|
-
|
|
224
|
+
catalogNavlink ? (React.createElement(Link, { to: catalogNavlink, style: { textDecoration: "none" } },
|
|
225
|
+
React.createElement(SideNavLink, { "data-testid": "sidenav-catalog-link", isActive: location.pathname.includes("/catalog"), renderIcon: Catalog }, "Catalog"))
|
|
226
|
+
// <SideNavLink
|
|
227
|
+
// to={catalogNavlink}
|
|
228
|
+
// data-testid="sidenav-catalog-link"
|
|
229
|
+
// isActive={windowLocation.href.includes(`${baseEnvUrl}/catalog`)}
|
|
230
|
+
// // href={catalogNavlink}
|
|
231
|
+
// renderIcon={Catalog}
|
|
232
|
+
// >
|
|
233
|
+
// Catalog
|
|
234
|
+
// </SideNavLink>
|
|
235
|
+
) : null,
|
|
225
236
|
settingsLink ? (React.createElement(SideNavLink, { "data-testid": "sidenav-settings-link", renderIcon: Settings, href: settingsLink, onClick: (e) => {
|
|
226
237
|
handleSettingsClick();
|
|
227
238
|
} }, "Settings")) : null,
|
package/package.json
CHANGED