@servicetitan/navigation 12.0.3 → 13.0.0-canary.256.44cf055.0
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/dist/components/counter-tag.d.ts +1 -1
- package/dist/components/counter-tag.d.ts.map +1 -1
- package/dist/components/counter-tag.js.map +1 -1
- package/dist/components/profile-dropdown/interface.d.ts +55 -0
- package/dist/components/profile-dropdown/interface.d.ts.map +1 -0
- package/dist/components/profile-dropdown/interface.js.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown-legacy.stories.d.ts +13 -0
- package/dist/components/profile-dropdown/profile-dropdown-legacy.stories.d.ts.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts +5 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.d.ts +9 -79
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +22 -22
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.stories.d.ts +5 -1
- package/dist/components/profile-dropdown/profile-dropdown.stories.d.ts.map +1 -1
- package/dist/components/titan-layout/interface-internal.d.ts +12 -0
- package/dist/components/titan-layout/interface-internal.d.ts.map +1 -1
- package/dist/components/titan-layout/interface-internal.js.map +1 -1
- package/dist/components/titan-layout/interface.d.ts +67 -14
- package/dist/components/titan-layout/interface.d.ts.map +1 -1
- package/dist/components/titan-layout/interface.js.map +1 -1
- package/dist/components/titan-layout/layout-header-dark.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header-dark.js +24 -12
- package/dist/components/titan-layout/layout-header-dark.js.map +1 -1
- package/dist/components/titan-layout/layout-header-links-internal.d.ts +22 -3
- package/dist/components/titan-layout/layout-header-links-internal.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header-links-internal.js +15 -18
- package/dist/components/titan-layout/layout-header-links-internal.js.map +1 -1
- package/dist/components/titan-layout/layout-header-links.d.ts +3 -4
- package/dist/components/titan-layout/layout-header-links.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header-links.js +25 -5
- package/dist/components/titan-layout/layout-header-links.js.map +1 -1
- package/dist/components/titan-layout/layout-header.d.ts +4 -2
- package/dist/components/titan-layout/layout-header.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header.js +25 -16
- package/dist/components/titan-layout/layout-header.js.map +1 -1
- package/dist/components/titan-layout/layout-header.module.less +37 -1
- package/dist/components/titan-layout/layout-header.module.less.d.ts +3 -0
- package/dist/components/titan-layout/layout-profile.d.ts +8 -5
- package/dist/components/titan-layout/layout-profile.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-profile.js +30 -28
- package/dist/components/titan-layout/layout-profile.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts +48 -31
- package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links-internal.js +87 -83
- package/dist/components/titan-layout/layout-sidebar-links-internal.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.d.ts +3 -3
- package/dist/components/titan-layout/layout-sidebar-links.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.js +32 -19
- package/dist/components/titan-layout/layout-sidebar-links.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.d.ts +1 -1
- package/dist/components/titan-layout/layout-sidebar.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.js +81 -102
- package/dist/components/titan-layout/layout-sidebar.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.module.less +74 -22
- package/dist/components/titan-layout/titan-layout-default.stories.d.ts +16 -0
- package/dist/components/titan-layout/titan-layout-default.stories.d.ts.map +1 -0
- package/dist/components/titan-layout/titan-layout-legacy.stories.d.ts +10 -0
- package/dist/components/titan-layout/titan-layout-legacy.stories.d.ts.map +1 -0
- package/dist/components/titan-layout/titan-layout-links.d.ts +5 -0
- package/dist/components/titan-layout/titan-layout-links.d.ts.map +1 -0
- package/dist/components/titan-layout/titan-layout-links.js +34 -0
- package/dist/components/titan-layout/titan-layout-links.js.map +1 -0
- package/dist/components/titan-layout/titan-layout-stacked.stories.d.ts +10 -0
- package/dist/components/titan-layout/titan-layout-stacked.stories.d.ts.map +1 -0
- package/dist/components/titan-layout/titan-layout.d.ts +5 -4
- package/dist/components/titan-layout/titan-layout.d.ts.map +1 -1
- package/dist/components/titan-layout/titan-layout.js +33 -14
- package/dist/components/titan-layout/titan-layout.js.map +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/test/data.d.ts +26 -23
- package/dist/test/data.d.ts.map +1 -1
- package/dist/test/data.js +26 -69
- package/dist/test/data.js.map +1 -1
- package/dist/test/titan-layout.d.ts +16 -0
- package/dist/test/titan-layout.d.ts.map +1 -0
- package/dist/test/titan-layout.js +21 -0
- package/dist/test/titan-layout.js.map +1 -0
- package/dist/utils/navigation-context.d.ts +3 -22
- package/dist/utils/navigation-context.d.ts.map +1 -1
- package/dist/utils/navigation-context.js +2 -10
- package/dist/utils/navigation-context.js.map +1 -1
- package/dist/utils/navigation.d.ts +2 -7
- package/dist/utils/navigation.d.ts.map +1 -1
- package/dist/utils/navigation.js.map +1 -1
- package/package.json +4 -4
- package/src/components/counter-tag.tsx +1 -1
- package/src/components/profile-dropdown/interface.ts +47 -0
- package/src/components/profile-dropdown/profile-dropdown-legacy.stories.tsx +25 -0
- package/src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx +15 -7
- package/src/components/profile-dropdown/profile-dropdown.stories.tsx +50 -43
- package/src/components/profile-dropdown/profile-dropdown.tsx +39 -115
- package/src/components/titan-layout/interface-internal.ts +13 -0
- package/src/components/titan-layout/interface.ts +73 -17
- package/src/components/titan-layout/layout-header-dark.tsx +21 -5
- package/src/components/titan-layout/layout-header-links-internal.tsx +41 -54
- package/src/components/titan-layout/layout-header-links.tsx +65 -12
- package/src/components/titan-layout/layout-header.module.less +37 -1
- package/src/components/titan-layout/layout-header.module.less.d.ts +3 -0
- package/src/components/titan-layout/layout-header.tsx +28 -15
- package/src/components/titan-layout/layout-profile.tsx +53 -34
- package/src/components/titan-layout/layout-sidebar-links-internal.tsx +188 -147
- package/src/components/titan-layout/layout-sidebar-links.tsx +73 -26
- package/src/components/titan-layout/layout-sidebar.module.less +74 -22
- package/src/components/titan-layout/layout-sidebar.tsx +55 -80
- package/src/components/titan-layout/{titan-layout.stories.tsx → titan-layout-default.stories.tsx} +131 -114
- package/src/components/titan-layout/titan-layout-legacy.stories.tsx +24 -0
- package/src/components/titan-layout/titan-layout-links.tsx +34 -0
- package/src/components/titan-layout/titan-layout-stacked.stories.tsx +30 -0
- package/src/components/titan-layout/titan-layout.tsx +39 -15
- package/src/index.ts +1 -12
- package/src/test/data.tsx +31 -83
- package/src/test/titan-layout.tsx +34 -0
- package/src/utils/navigation-context.tsx +9 -35
- package/src/utils/navigation.ts +3 -10
- package/dist/components/header-navigation/header-navigation-content.d.ts +0 -30
- package/dist/components/header-navigation/header-navigation-content.d.ts.map +0 -1
- package/dist/components/header-navigation/header-navigation-content.js +0 -58
- package/dist/components/header-navigation/header-navigation-content.js.map +0 -1
- package/dist/components/header-navigation/header-navigation-extra-stacked.stories.d.ts +0 -9
- package/dist/components/header-navigation/header-navigation-extra-stacked.stories.d.ts.map +0 -1
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts +0 -12
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts.map +0 -1
- package/dist/components/header-navigation/header-navigation-links.d.ts +0 -11
- package/dist/components/header-navigation/header-navigation-links.d.ts.map +0 -1
- package/dist/components/header-navigation/header-navigation-links.js +0 -62
- package/dist/components/header-navigation/header-navigation-links.js.map +0 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts +0 -12
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts.map +0 -1
- package/dist/components/header-navigation/header-navigation-stories.module.less +0 -6
- package/dist/components/header-navigation/header-navigation-stories.module.less.d.ts +0 -3
- package/dist/components/header-navigation/header-navigation.d.ts +0 -59
- package/dist/components/header-navigation/header-navigation.d.ts.map +0 -1
- package/dist/components/header-navigation/header-navigation.js +0 -228
- package/dist/components/header-navigation/header-navigation.js.map +0 -1
- package/dist/components/header-navigation/header-navigation.module.less +0 -260
- package/dist/components/header-navigation/header-navigation.module.less.d.ts +0 -22
- package/dist/components/header-navigation/header-navigation.stories.d.ts +0 -12
- package/dist/components/header-navigation/header-navigation.stories.d.ts.map +0 -1
- package/dist/components/header-navigation/index.d.ts +0 -2
- package/dist/components/header-navigation/index.d.ts.map +0 -1
- package/dist/components/header-navigation/index.js +0 -3
- package/dist/components/header-navigation/index.js.map +0 -1
- package/dist/components/header-navigation/with-tooltip.d.ts +0 -4
- package/dist/components/header-navigation/with-tooltip.d.ts.map +0 -1
- package/dist/components/header-navigation/with-tooltip.js +0 -10
- package/dist/components/header-navigation/with-tooltip.js.map +0 -1
- package/dist/components/layout.stories.d.ts +0 -13
- package/dist/components/layout.stories.d.ts.map +0 -1
- package/dist/components/left-navigation/header-navigation-extra-tiny.stories.d.ts +0 -9
- package/dist/components/left-navigation/header-navigation-extra-tiny.stories.d.ts.map +0 -1
- package/dist/components/left-navigation/header-navigation-tiny-links.d.ts +0 -18
- package/dist/components/left-navigation/header-navigation-tiny-links.d.ts.map +0 -1
- package/dist/components/left-navigation/header-navigation-tiny-links.js +0 -79
- package/dist/components/left-navigation/header-navigation-tiny-links.js.map +0 -1
- package/dist/components/left-navigation/header-navigation-tiny.d.ts +0 -23
- package/dist/components/left-navigation/header-navigation-tiny.d.ts.map +0 -1
- package/dist/components/left-navigation/header-navigation-tiny.js +0 -32
- package/dist/components/left-navigation/header-navigation-tiny.js.map +0 -1
- package/dist/components/left-navigation/header-navigation-tiny.module.less +0 -117
- package/dist/components/left-navigation/header-navigation-tiny.module.less.d.ts +0 -15
- package/dist/components/left-navigation/header-navigation-tiny.stories.d.ts +0 -12
- package/dist/components/left-navigation/header-navigation-tiny.stories.d.ts.map +0 -1
- package/dist/components/left-navigation/index.d.ts +0 -5
- package/dist/components/left-navigation/index.d.ts.map +0 -1
- package/dist/components/left-navigation/index.js +0 -5
- package/dist/components/left-navigation/index.js.map +0 -1
- package/dist/components/left-navigation/interface-internal.d.ts +0 -10
- package/dist/components/left-navigation/interface-internal.d.ts.map +0 -1
- package/dist/components/left-navigation/interface-internal.js +0 -3
- package/dist/components/left-navigation/interface-internal.js.map +0 -1
- package/dist/components/left-navigation/interface.d.ts +0 -20
- package/dist/components/left-navigation/interface.d.ts.map +0 -1
- package/dist/components/left-navigation/interface.js.map +0 -1
- package/dist/components/left-navigation/side-navigation-context.d.ts +0 -8
- package/dist/components/left-navigation/side-navigation-context.d.ts.map +0 -1
- package/dist/components/left-navigation/side-navigation-context.js +0 -8
- package/dist/components/left-navigation/side-navigation-context.js.map +0 -1
- package/dist/components/left-navigation/side-navigation-links-internal.d.ts +0 -28
- package/dist/components/left-navigation/side-navigation-links-internal.d.ts.map +0 -1
- package/dist/components/left-navigation/side-navigation-links-internal.js +0 -89
- package/dist/components/left-navigation/side-navigation-links-internal.js.map +0 -1
- package/dist/components/left-navigation/side-navigation-links.d.ts +0 -6
- package/dist/components/left-navigation/side-navigation-links.d.ts.map +0 -1
- package/dist/components/left-navigation/side-navigation-links.js +0 -48
- package/dist/components/left-navigation/side-navigation-links.js.map +0 -1
- package/dist/components/left-navigation/side-navigation.d.ts +0 -29
- package/dist/components/left-navigation/side-navigation.d.ts.map +0 -1
- package/dist/components/left-navigation/side-navigation.js +0 -411
- package/dist/components/left-navigation/side-navigation.js.map +0 -1
- package/dist/components/left-navigation/side-navigation.module.less +0 -530
- package/dist/components/left-navigation/side-navigation.module.less.d.ts +0 -48
- package/dist/components/left-navigation/side-navigation.stories.d.ts +0 -17
- package/dist/components/left-navigation/side-navigation.stories.d.ts.map +0 -1
- package/dist/components/left-navigation/with-tooltip.d.ts +0 -4
- package/dist/components/left-navigation/with-tooltip.d.ts.map +0 -1
- package/dist/components/left-navigation/with-tooltip.js +0 -15
- package/dist/components/left-navigation/with-tooltip.js.map +0 -1
- package/dist/components/links.d.ts +0 -5
- package/dist/components/links.d.ts.map +0 -1
- package/dist/components/links.js +0 -35
- package/dist/components/links.js.map +0 -1
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.d.ts +0 -9
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.d.ts.map +0 -1
- package/dist/components/titan-layout/layout-profile.stories.d.ts +0 -13
- package/dist/components/titan-layout/layout-profile.stories.d.ts.map +0 -1
- package/dist/components/titan-layout/titan-layout.stories.d.ts +0 -29
- package/dist/components/titan-layout/titan-layout.stories.d.ts.map +0 -1
- package/dist/utils/navigation-legacy.d.ts +0 -88
- package/dist/utils/navigation-legacy.d.ts.map +0 -1
- package/dist/utils/navigation-legacy.js +0 -3
- package/dist/utils/navigation-legacy.js.map +0 -1
- package/src/components/header-navigation/header-navigation-content.tsx +0 -120
- package/src/components/header-navigation/header-navigation-extra-stacked.stories.tsx +0 -19
- package/src/components/header-navigation/header-navigation-extra.stories.tsx +0 -142
- package/src/components/header-navigation/header-navigation-links.tsx +0 -141
- package/src/components/header-navigation/header-navigation-stacked.stories.tsx +0 -146
- package/src/components/header-navigation/header-navigation-stories.module.less +0 -6
- package/src/components/header-navigation/header-navigation-stories.module.less.d.ts +0 -3
- package/src/components/header-navigation/header-navigation.module.less +0 -260
- package/src/components/header-navigation/header-navigation.module.less.d.ts +0 -22
- package/src/components/header-navigation/header-navigation.stories.tsx +0 -165
- package/src/components/header-navigation/header-navigation.tsx +0 -327
- package/src/components/header-navigation/index.ts +0 -1
- package/src/components/header-navigation/with-tooltip.tsx +0 -15
- package/src/components/layout.stories.tsx +0 -103
- package/src/components/left-navigation/header-navigation-extra-tiny.stories.tsx +0 -21
- package/src/components/left-navigation/header-navigation-tiny-links.tsx +0 -145
- package/src/components/left-navigation/header-navigation-tiny.module.less +0 -117
- package/src/components/left-navigation/header-navigation-tiny.module.less.d.ts +0 -15
- package/src/components/left-navigation/header-navigation-tiny.stories.tsx +0 -178
- package/src/components/left-navigation/header-navigation-tiny.tsx +0 -65
- package/src/components/left-navigation/index.ts +0 -4
- package/src/components/left-navigation/interface-internal.ts +0 -11
- package/src/components/left-navigation/interface.ts +0 -26
- package/src/components/left-navigation/side-navigation-context.tsx +0 -13
- package/src/components/left-navigation/side-navigation-links-internal.tsx +0 -151
- package/src/components/left-navigation/side-navigation-links.tsx +0 -57
- package/src/components/left-navigation/side-navigation.module.less +0 -530
- package/src/components/left-navigation/side-navigation.module.less.d.ts +0 -48
- package/src/components/left-navigation/side-navigation.stories.tsx +0 -226
- package/src/components/left-navigation/side-navigation.tsx +0 -543
- package/src/components/left-navigation/with-tooltip.tsx +0 -16
- package/src/components/links.tsx +0 -54
- package/src/components/profile-dropdown/profile-dropdown-tiny.stories.tsx +0 -25
- package/src/components/titan-layout/layout-profile.stories.tsx +0 -46
- package/src/utils/navigation-legacy.ts +0 -106
- /package/dist/components/{left-navigation → profile-dropdown}/interface.js +0 -0
|
@@ -3,6 +3,7 @@ import SvgMoreVert from '@servicetitan/anvil2/assets/icons/material/round/more_v
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { NavigationItemData } from '../../utils/navigation';
|
|
6
|
+
import { getCounterTag } from '../../utils/side-nav';
|
|
6
7
|
import { NavigationComponentProps } from './interface-internal';
|
|
7
8
|
import { useTitanLayoutContext } from './layout-context';
|
|
8
9
|
import { LayoutHeader, LayoutHeaderProps } from './layout-header';
|
|
@@ -34,7 +35,6 @@ export const LayoutHeaderDark: FC<LayoutHeaderStackedProps> = ({
|
|
|
34
35
|
navigationMainItems,
|
|
35
36
|
navigationOverflowItems,
|
|
36
37
|
hasNotifications,
|
|
37
|
-
onBurgerClick,
|
|
38
38
|
logo,
|
|
39
39
|
profile,
|
|
40
40
|
right,
|
|
@@ -42,6 +42,8 @@ export const LayoutHeaderDark: FC<LayoutHeaderStackedProps> = ({
|
|
|
42
42
|
rightClassName,
|
|
43
43
|
center,
|
|
44
44
|
centerClassName,
|
|
45
|
+
hasBurger,
|
|
46
|
+
onBurgerClick,
|
|
45
47
|
...rest
|
|
46
48
|
}) => {
|
|
47
49
|
return center ? (
|
|
@@ -62,6 +64,7 @@ export const LayoutHeaderDark: FC<LayoutHeaderStackedProps> = ({
|
|
|
62
64
|
logo={logo}
|
|
63
65
|
profile={profile}
|
|
64
66
|
onBurgerClick={onBurgerClick}
|
|
67
|
+
hasBurger={hasBurger}
|
|
65
68
|
data-cy="header-navigation-top"
|
|
66
69
|
/>
|
|
67
70
|
|
|
@@ -94,6 +97,7 @@ export const LayoutHeaderDark: FC<LayoutHeaderStackedProps> = ({
|
|
|
94
97
|
logo={logo}
|
|
95
98
|
profile={profile}
|
|
96
99
|
onBurgerClick={onBurgerClick}
|
|
100
|
+
hasBurger={hasBurger}
|
|
97
101
|
{...rest}
|
|
98
102
|
/>
|
|
99
103
|
);
|
|
@@ -155,8 +159,14 @@ const LayoutHeaderNav: FC<LayoutHeaderNavProps> = ({ className, mainItems, overf
|
|
|
155
159
|
{mainItems?.map(item =>
|
|
156
160
|
withTooltip(
|
|
157
161
|
<InternalLayoutHeaderNavigationLink
|
|
158
|
-
{
|
|
159
|
-
|
|
162
|
+
id={item.id}
|
|
163
|
+
to={item.to}
|
|
164
|
+
title={isMinimized ? undefined : item.title}
|
|
165
|
+
isActive={item.isActive}
|
|
166
|
+
icon={item.icon}
|
|
167
|
+
iconActive={item.iconActive}
|
|
168
|
+
tag={getCounterTag(item.counter, item.tag)}
|
|
169
|
+
className={item.className}
|
|
160
170
|
key={item.id}
|
|
161
171
|
navigationComponent={NavigationComponent}
|
|
162
172
|
/>,
|
|
@@ -195,8 +205,14 @@ const LayoutHeaderNavOverflow: FC<
|
|
|
195
205
|
<div data-cy="navigation-overflow-content" className={Styles.headerNavigationOverflow}>
|
|
196
206
|
{items.map(item => (
|
|
197
207
|
<InternalLayoutHeaderNavigationLink
|
|
198
|
-
{
|
|
199
|
-
|
|
208
|
+
id={item.id}
|
|
209
|
+
to={item.to}
|
|
210
|
+
title={item.title}
|
|
211
|
+
isActive={item.isActive}
|
|
212
|
+
icon={item.icon}
|
|
213
|
+
iconActive={item.iconActive}
|
|
214
|
+
tag={getCounterTag(item.counter, item.tag)}
|
|
215
|
+
className={item.className}
|
|
200
216
|
key={item.id}
|
|
201
217
|
navigationComponent={navigationComponent}
|
|
202
218
|
isOverflow
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { Icon, IconProps } from '@servicetitan/anvil2';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { FC, Fragment } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
HeaderNavigationLinkProps,
|
|
6
|
-
HeaderNavigationTriggerProps,
|
|
7
|
-
} from '../../utils/navigation-legacy';
|
|
8
|
-
import { getCounterTag } from '../../utils/side-nav';
|
|
4
|
+
import { CounterTagData } from '../../utils/counter-tag';
|
|
9
5
|
import { CounterTag, CounterTagProps } from '../counter-tag';
|
|
10
|
-
// use v1 tooltips due to bug with v2 in monolith
|
|
11
6
|
import { NavigationComponentProps } from './interface-internal';
|
|
12
7
|
import * as Styles from './layout-header.module.less';
|
|
13
8
|
|
|
@@ -17,9 +12,8 @@ const InternalHeaderNavigationItemContent: FC<{
|
|
|
17
12
|
counterClassName?: string;
|
|
18
13
|
icon: IconProps['svg'] | undefined;
|
|
19
14
|
iconActive?: IconProps['svg'];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}> = ({ counterClassName, icon, iconActive, label, labelClassName, tag }) => {
|
|
15
|
+
title?: string;
|
|
16
|
+
}> = ({ counterClassName, icon, iconActive, title, tag }) => {
|
|
23
17
|
return (
|
|
24
18
|
<Fragment>
|
|
25
19
|
{!!icon && <Icon svg={icon} className={Styles.navigationIcon} />}
|
|
@@ -30,12 +24,9 @@ const InternalHeaderNavigationItemContent: FC<{
|
|
|
30
24
|
/>
|
|
31
25
|
)}
|
|
32
26
|
|
|
33
|
-
{!!
|
|
34
|
-
<span
|
|
35
|
-
|
|
36
|
-
data-cy="nav-item-label"
|
|
37
|
-
>
|
|
38
|
-
{label}
|
|
27
|
+
{!!title && (
|
|
28
|
+
<span className={Styles.navigationItemLabel} data-cy="nav-item-label">
|
|
29
|
+
{title}
|
|
39
30
|
</span>
|
|
40
31
|
)}
|
|
41
32
|
|
|
@@ -52,26 +43,30 @@ const InternalHeaderNavigationItemContent: FC<{
|
|
|
52
43
|
|
|
53
44
|
/** Navigation extra item with link */
|
|
54
45
|
export const InternalLayoutHeaderNavigationLink: FC<
|
|
55
|
-
|
|
46
|
+
NavigationComponentProps & {
|
|
47
|
+
id: string;
|
|
48
|
+
to: string;
|
|
49
|
+
title: string | undefined;
|
|
50
|
+
isActive: boolean | ((pathname: string) => boolean) | undefined;
|
|
51
|
+
icon: IconProps['svg'] | undefined;
|
|
52
|
+
iconActive: IconProps['svg'] | undefined;
|
|
53
|
+
tag: CounterTagData | undefined;
|
|
54
|
+
className: string | undefined;
|
|
55
|
+
|
|
56
|
+
isOverflow?: boolean;
|
|
57
|
+
flashing?: boolean;
|
|
58
|
+
}
|
|
56
59
|
> = ({
|
|
57
60
|
id,
|
|
58
61
|
to,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className,
|
|
62
|
-
counter,
|
|
62
|
+
title,
|
|
63
|
+
isActive,
|
|
63
64
|
icon,
|
|
64
65
|
iconActive,
|
|
65
|
-
iconClassName,
|
|
66
|
-
iconName,
|
|
67
|
-
iconComponent,
|
|
68
|
-
isActive,
|
|
69
|
-
isOverflow,
|
|
70
|
-
label,
|
|
71
|
-
labelClassName,
|
|
72
66
|
tag,
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
className,
|
|
68
|
+
isOverflow,
|
|
69
|
+
flashing,
|
|
75
70
|
navigationComponent: NavigationComponent,
|
|
76
71
|
...rest
|
|
77
72
|
}) => {
|
|
@@ -88,63 +83,55 @@ export const InternalLayoutHeaderNavigationLink: FC<
|
|
|
88
83
|
{
|
|
89
84
|
[Styles.navigationItemActive]: isActive === true,
|
|
90
85
|
[Styles.navigationItemIconState]: !!icon && !!iconActive,
|
|
86
|
+
[Styles.navigationItemFlashing]: flashing,
|
|
91
87
|
}
|
|
92
88
|
)}
|
|
93
89
|
isActive={typeof isActive === 'function' ? isActive : undefined}
|
|
94
90
|
activeClassName={Styles.navigationItemActive}
|
|
95
|
-
target={target}
|
|
96
91
|
>
|
|
97
92
|
<InternalHeaderNavigationItemContent
|
|
98
|
-
tag={
|
|
93
|
+
tag={tag}
|
|
99
94
|
icon={icon}
|
|
100
95
|
iconActive={iconActive}
|
|
101
|
-
|
|
102
|
-
labelClassName={labelClassName}
|
|
96
|
+
title={title}
|
|
103
97
|
/>
|
|
104
98
|
</NavigationComponent>
|
|
105
99
|
);
|
|
106
100
|
};
|
|
107
101
|
|
|
108
102
|
/** Navigation extra item with icon button */
|
|
109
|
-
export const InternalLayoutHeaderNavigationTrigger: FC<
|
|
110
|
-
id
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
icon
|
|
114
|
-
iconActive
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
tag,
|
|
121
|
-
tooltip,
|
|
122
|
-
title,
|
|
123
|
-
titleClassName,
|
|
124
|
-
...rest
|
|
125
|
-
}) => {
|
|
103
|
+
export const InternalLayoutHeaderNavigationTrigger: FC<{
|
|
104
|
+
id: string;
|
|
105
|
+
title: string | undefined;
|
|
106
|
+
isActive: boolean | undefined;
|
|
107
|
+
icon: IconProps['svg'] | undefined;
|
|
108
|
+
iconActive: IconProps['svg'] | undefined;
|
|
109
|
+
tag: CounterTagData | undefined;
|
|
110
|
+
className: string | undefined;
|
|
111
|
+
|
|
112
|
+
flashing?: boolean;
|
|
113
|
+
}> = ({ id, className, flashing, icon, iconActive, isActive, tag, title, ...rest }) => {
|
|
126
114
|
return (
|
|
127
115
|
<div
|
|
128
116
|
data-cy={`navigation-trigger-${id}`}
|
|
129
117
|
data-pendo={`navigation-trigger-${id}`}
|
|
130
118
|
{...rest}
|
|
131
|
-
title={hint}
|
|
132
119
|
className={classNames(
|
|
133
120
|
Styles.navigationLink,
|
|
134
121
|
{
|
|
135
122
|
[Styles.navigationItemActive]: isActive === true,
|
|
136
123
|
[Styles.navigationItemIconState]: !!icon && !!iconActive,
|
|
124
|
+
[Styles.navigationItemFlashing]: flashing,
|
|
137
125
|
},
|
|
138
126
|
'cursor-pointer',
|
|
139
127
|
className
|
|
140
128
|
)}
|
|
141
129
|
>
|
|
142
130
|
<InternalHeaderNavigationItemContent
|
|
143
|
-
tag={
|
|
131
|
+
tag={tag}
|
|
144
132
|
icon={icon}
|
|
145
133
|
iconActive={iconActive}
|
|
146
|
-
|
|
147
|
-
labelClassName={labelClassName}
|
|
134
|
+
title={title}
|
|
148
135
|
/>
|
|
149
136
|
</div>
|
|
150
137
|
);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
HeaderNavigationLinkProps,
|
|
4
|
-
HeaderNavigationTriggerProps,
|
|
5
|
-
} from '../../utils/navigation-legacy';
|
|
1
|
+
import { getCounterTag } from '../../utils/side-nav';
|
|
2
|
+
import { TitanLayoutLinkProps, TitanLayoutTriggerProps } from './interface';
|
|
6
3
|
import { useTitanLayoutContext } from './layout-context';
|
|
7
4
|
import {
|
|
8
5
|
InternalLayoutHeaderNavigationLink,
|
|
@@ -11,19 +8,75 @@ import {
|
|
|
11
8
|
import { withTooltip } from './with-tooltip';
|
|
12
9
|
|
|
13
10
|
/** Navigation extra item with link */
|
|
14
|
-
export
|
|
11
|
+
export function LayoutHeaderNavigationLink({
|
|
12
|
+
id,
|
|
13
|
+
to,
|
|
14
|
+
title,
|
|
15
|
+
isActive,
|
|
16
|
+
icon,
|
|
17
|
+
iconActive,
|
|
18
|
+
counter,
|
|
19
|
+
tag,
|
|
20
|
+
className,
|
|
21
|
+
|
|
22
|
+
tooltip,
|
|
23
|
+
extra,
|
|
24
|
+
side,
|
|
25
|
+
wrapper,
|
|
26
|
+
...rest
|
|
27
|
+
}: TitanLayoutLinkProps) {
|
|
15
28
|
const { NavigationComponent } = useTitanLayoutContext();
|
|
29
|
+
const { showTitle, flashing } = extra ?? {};
|
|
16
30
|
|
|
17
31
|
return withTooltip(
|
|
18
|
-
<InternalLayoutHeaderNavigationLink
|
|
32
|
+
<InternalLayoutHeaderNavigationLink
|
|
33
|
+
id={id}
|
|
34
|
+
to={to}
|
|
35
|
+
title={showTitle ? title : undefined}
|
|
36
|
+
isActive={isActive}
|
|
37
|
+
icon={icon}
|
|
38
|
+
iconActive={iconActive}
|
|
39
|
+
tag={getCounterTag(counter, tag)}
|
|
40
|
+
className={className}
|
|
41
|
+
{...rest}
|
|
42
|
+
flashing={flashing}
|
|
43
|
+
navigationComponent={NavigationComponent}
|
|
44
|
+
/>,
|
|
19
45
|
tooltip
|
|
20
46
|
);
|
|
21
|
-
}
|
|
47
|
+
}
|
|
22
48
|
|
|
23
49
|
/** Navigation extra item with icon button */
|
|
24
|
-
export
|
|
50
|
+
export function LayoutHeaderNavigationTrigger({
|
|
51
|
+
id,
|
|
52
|
+
title,
|
|
53
|
+
isActive,
|
|
54
|
+
icon,
|
|
55
|
+
iconActive,
|
|
56
|
+
counter,
|
|
57
|
+
tag,
|
|
58
|
+
className,
|
|
59
|
+
|
|
25
60
|
tooltip,
|
|
61
|
+
extra,
|
|
62
|
+
side,
|
|
63
|
+
wrapper,
|
|
26
64
|
...rest
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
|
|
65
|
+
}: TitanLayoutTriggerProps) {
|
|
66
|
+
const { showTitle, flashing } = extra ?? {};
|
|
67
|
+
|
|
68
|
+
return withTooltip(
|
|
69
|
+
<InternalLayoutHeaderNavigationTrigger
|
|
70
|
+
id={id}
|
|
71
|
+
title={showTitle ? title : undefined}
|
|
72
|
+
isActive={isActive}
|
|
73
|
+
icon={icon}
|
|
74
|
+
iconActive={iconActive}
|
|
75
|
+
tag={getCounterTag(counter, tag)}
|
|
76
|
+
className={className}
|
|
77
|
+
{...rest}
|
|
78
|
+
flashing={flashing}
|
|
79
|
+
/>,
|
|
80
|
+
tooltip
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
/* stylelint-disable no-duplicate-selectors */
|
|
3
3
|
@import (reference) '@servicetitan/tokens/core/tokens.less';
|
|
4
4
|
|
|
5
|
+
@keyframes ExtraPulseAnimation {
|
|
6
|
+
0% {
|
|
7
|
+
opacity: 0.7;
|
|
8
|
+
}
|
|
9
|
+
50% {
|
|
10
|
+
opacity: 0.5;
|
|
11
|
+
}
|
|
12
|
+
100% {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
5
17
|
@size-links-tiny: 24px;
|
|
6
18
|
@bg-light: @color-white;
|
|
7
19
|
@bg-dark: @color-neutral-300;
|
|
@@ -36,6 +48,11 @@
|
|
|
36
48
|
overflow-y: hidden;
|
|
37
49
|
}
|
|
38
50
|
|
|
51
|
+
.he-top-left {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
}
|
|
55
|
+
|
|
39
56
|
.he-top-center {
|
|
40
57
|
overflow: hidden;
|
|
41
58
|
}
|
|
@@ -146,7 +163,7 @@
|
|
|
146
163
|
grid-template-columns: repeat(3, 1fr);
|
|
147
164
|
grid-template-rows: 48px;
|
|
148
165
|
|
|
149
|
-
.
|
|
166
|
+
.he-top-left,
|
|
150
167
|
.he-top-center,
|
|
151
168
|
.he-top-right {
|
|
152
169
|
grid-column: span 1;
|
|
@@ -352,6 +369,25 @@
|
|
|
352
369
|
}
|
|
353
370
|
}
|
|
354
371
|
|
|
372
|
+
.he-top-right .navigation-item-flashing {
|
|
373
|
+
&::before {
|
|
374
|
+
content: '';
|
|
375
|
+
position: absolute;
|
|
376
|
+
animation-name: ExtraPulseAnimation;
|
|
377
|
+
will-change: opacity;
|
|
378
|
+
background-color: var(--color-neutral-60, @color-neutral-60);
|
|
379
|
+
animation-iteration-count: infinite;
|
|
380
|
+
animation-duration: 500ms;
|
|
381
|
+
animation-direction: alternate;
|
|
382
|
+
border-radius: 12px;
|
|
383
|
+
inset: 0;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
&.navigation-item-active::before {
|
|
387
|
+
background-color: var(--color-blue-200, @color-blue-200);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
355
391
|
// styles specific to main nav links
|
|
356
392
|
.header-navigation .navigation-link {
|
|
357
393
|
font-family: @base-font-family;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export const __esModule: true;
|
|
2
2
|
export const burger: string;
|
|
3
3
|
export const calculating: string;
|
|
4
|
+
export const extraPulseAnimation: string;
|
|
4
5
|
export const heTopCenter: string;
|
|
6
|
+
export const heTopLeft: string;
|
|
5
7
|
export const heTopRight: string;
|
|
6
8
|
export const heTopRightText: string;
|
|
7
9
|
export const header: string;
|
|
@@ -29,6 +31,7 @@ export const navigationIconActive: string;
|
|
|
29
31
|
export const navigationItemActive: string;
|
|
30
32
|
export const navigationItemCounter: string;
|
|
31
33
|
export const navigationItemCounterLong: string;
|
|
34
|
+
export const navigationItemFlashing: string;
|
|
32
35
|
export const navigationItemIconState: string;
|
|
33
36
|
export const navigationItemLabel: string;
|
|
34
37
|
export const navigationLink: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import SvgBurgerMenu from '@servicetitan/anvil2/assets/icons/material/round/menu.svg';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import { ComponentPropsWithoutRef, FC, ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { ComponentPropsWithoutRef, FC, MouseEvent, ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { LayoutPlacementContext } from './layout-context';
|
|
5
5
|
import { LayoutHeaderNavigationTrigger } from './layout-header-links';
|
|
6
6
|
import * as Styles from './layout-header.module.less';
|
|
7
7
|
import { LayoutLogo, TitanLayoutLogoProps, isLogoCustom } from './layout-logo';
|
|
8
|
+
import { withTooltip } from './with-tooltip';
|
|
8
9
|
|
|
9
10
|
export type LayoutHeaderProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
10
11
|
right?: ReactNode;
|
|
@@ -22,7 +23,9 @@ export type LayoutHeaderProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'
|
|
|
22
23
|
isMobile: boolean;
|
|
23
24
|
variant: 'light' | 'dark';
|
|
24
25
|
hasNotifications: boolean;
|
|
25
|
-
|
|
26
|
+
hasBurger: boolean;
|
|
27
|
+
burgerTooltip?: string;
|
|
28
|
+
onBurgerClick?: (e: MouseEvent<never>) => void;
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
export const LayoutHeader: FC<LayoutHeaderProps> = ({
|
|
@@ -37,9 +40,24 @@ export const LayoutHeader: FC<LayoutHeaderProps> = ({
|
|
|
37
40
|
logo,
|
|
38
41
|
profile,
|
|
39
42
|
variant,
|
|
43
|
+
hasBurger,
|
|
44
|
+
burgerTooltip,
|
|
40
45
|
onBurgerClick,
|
|
41
46
|
...rest
|
|
42
47
|
}) => {
|
|
48
|
+
const burgerElement = hasBurger && (
|
|
49
|
+
<div className={Styles.burger}>
|
|
50
|
+
<LayoutHeaderNavigationTrigger
|
|
51
|
+
id="burger"
|
|
52
|
+
title=""
|
|
53
|
+
icon={SvgBurgerMenu}
|
|
54
|
+
iconActive={undefined}
|
|
55
|
+
onClick={onBurgerClick}
|
|
56
|
+
tag={{ value: hasNotifications }}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
|
|
43
61
|
return (
|
|
44
62
|
<LayoutPlacementContext.Provider value="top">
|
|
45
63
|
<div
|
|
@@ -53,19 +71,14 @@ export const LayoutHeader: FC<LayoutHeaderProps> = ({
|
|
|
53
71
|
data-cy="header-navigation"
|
|
54
72
|
{...rest}
|
|
55
73
|
>
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
tag={{ value: hasNotifications }}
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
)}
|
|
68
|
-
<LayoutLogo {...logo} />
|
|
74
|
+
<div className={Styles.heTopLeft}>
|
|
75
|
+
{burgerElement &&
|
|
76
|
+
(burgerTooltip
|
|
77
|
+
? withTooltip(burgerElement, burgerTooltip, { placement: 'bottom-end' })
|
|
78
|
+
: burgerElement)}
|
|
79
|
+
<LayoutLogo {...logo} />
|
|
80
|
+
</div>
|
|
81
|
+
|
|
69
82
|
<div
|
|
70
83
|
className={classNames(
|
|
71
84
|
Styles.heTopCenter,
|
|
@@ -2,13 +2,14 @@ import SvgAccountActive from '@servicetitan/anvil2/assets/icons/st/gnav_account_
|
|
|
2
2
|
import SvgAccountInactive from '@servicetitan/anvil2/assets/icons/st/gnav_account_inactive.svg';
|
|
3
3
|
|
|
4
4
|
import { FC, MouseEvent, useEffect, useState } from 'react';
|
|
5
|
-
import { NavLinkComponentProps
|
|
5
|
+
import { NavLinkComponentProps } from '../../utils/navigation-context';
|
|
6
|
+
import { getCounterTag } from '../../utils/side-nav';
|
|
6
7
|
import {
|
|
7
|
-
ProfileDropdown as DesktopProfileDropdown,
|
|
8
8
|
ProfileDropdownLinkProps,
|
|
9
9
|
ProfileDropdownProps,
|
|
10
10
|
ProfileDropdownSectionProps,
|
|
11
|
-
} from '../profile-dropdown/
|
|
11
|
+
} from '../profile-dropdown/interface';
|
|
12
|
+
import { DesktopProfileDropdown } from '../profile-dropdown/profile-dropdown';
|
|
12
13
|
import { NavigationComponentProps } from './interface-internal';
|
|
13
14
|
import { useTitanLayoutContext } from './layout-context';
|
|
14
15
|
import {
|
|
@@ -23,7 +24,7 @@ export type {
|
|
|
23
24
|
ProfileDropdownProps,
|
|
24
25
|
ProfileDropdownSectionProps,
|
|
25
26
|
ProfileDropdownLinkProps,
|
|
26
|
-
} from '../profile-dropdown/
|
|
27
|
+
} from '../profile-dropdown/interface';
|
|
27
28
|
|
|
28
29
|
const ExternalNavComponent: FC<NavLinkComponentProps> = ({
|
|
29
30
|
children,
|
|
@@ -37,24 +38,27 @@ const ExternalNavComponent: FC<NavLinkComponentProps> = ({
|
|
|
37
38
|
</a>
|
|
38
39
|
);
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
const {
|
|
41
|
+
function ProfileDropdownComponent(props: ProfileDropdownProps) {
|
|
42
|
+
const { breakpoint, NavigationComponent } = useTitanLayoutContext();
|
|
42
43
|
return breakpoint.isMobile ? (
|
|
43
44
|
<MobileProfileDropdown {...props} navigationComponent={NavigationComponent} />
|
|
44
|
-
) : isTitanLayout ? (
|
|
45
|
-
<NavigationComponentContext.Provider value={NavigationComponent}>
|
|
46
|
-
<DesktopProfileDropdown {...props} />
|
|
47
|
-
</NavigationComponentContext.Provider>
|
|
48
45
|
) : (
|
|
49
46
|
<DesktopProfileDropdown {...props} />
|
|
50
47
|
);
|
|
51
|
-
}
|
|
52
|
-
ProfileDropdownContent.displayName = 'ProfileDropdown';
|
|
48
|
+
}
|
|
53
49
|
const profileId = '--profile';
|
|
54
50
|
|
|
55
51
|
const MobileProfileDropdown: FC<ProfileDropdownProps & NavigationComponentProps> = ({
|
|
52
|
+
direction,
|
|
53
|
+
trigger,
|
|
54
|
+
hintPopup,
|
|
55
|
+
portal,
|
|
56
|
+
width,
|
|
57
|
+
onClose,
|
|
58
|
+
onOpen,
|
|
59
|
+
className,
|
|
56
60
|
children,
|
|
57
|
-
...
|
|
61
|
+
...rest
|
|
58
62
|
}) => {
|
|
59
63
|
const [expanded, setExpanded] = useState(false);
|
|
60
64
|
const { hasNotifications, NotificationsContextProvider } = useNotificationsState();
|
|
@@ -77,7 +81,8 @@ const MobileProfileDropdown: FC<ProfileDropdownProps & NavigationComponentProps>
|
|
|
77
81
|
icon={SvgAccountInactive}
|
|
78
82
|
iconActive={SvgAccountActive}
|
|
79
83
|
isActive={expanded}
|
|
80
|
-
{
|
|
84
|
+
className={className}
|
|
85
|
+
{...rest}
|
|
81
86
|
submenuExpanded={expanded}
|
|
82
87
|
onExpandToggle={onExpandToggle}
|
|
83
88
|
onClick={onExpandToggle}
|
|
@@ -110,71 +115,85 @@ const getText = (children: any, text: any): string | undefined => {
|
|
|
110
115
|
return undefined;
|
|
111
116
|
};
|
|
112
117
|
|
|
113
|
-
|
|
114
|
-
tag: ProfileDropdownLinkProps['tag'],
|
|
115
|
-
counter: ProfileDropdownLinkProps['counter']
|
|
116
|
-
): boolean => {
|
|
117
|
-
return !!tag?.value || !!counter;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = props => {
|
|
118
|
+
function ProfileDropdownSection(props: ProfileDropdownSectionProps) {
|
|
121
119
|
const { breakpoint } = useTitanLayoutContext();
|
|
122
120
|
return breakpoint.isMobile ? (
|
|
123
121
|
<MobileProfileDropdownSection {...props} />
|
|
124
122
|
) : (
|
|
125
123
|
<DesktopProfileDropdown.Section {...props} />
|
|
126
124
|
);
|
|
127
|
-
}
|
|
125
|
+
}
|
|
128
126
|
const MobileProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
|
|
127
|
+
id,
|
|
128
|
+
tooltip,
|
|
129
|
+
tag,
|
|
130
|
+
counter,
|
|
131
|
+
|
|
132
|
+
className,
|
|
129
133
|
children,
|
|
130
134
|
text,
|
|
131
|
-
|
|
132
|
-
title,
|
|
133
|
-
...props
|
|
135
|
+
...rest
|
|
134
136
|
}) => {
|
|
135
137
|
const sectionText = getText(children, text);
|
|
136
138
|
const { onNotificationsUpdate } = useNotificationsContext();
|
|
137
|
-
|
|
139
|
+
const tagData = getCounterTag(counter, tag);
|
|
140
|
+
onNotificationsUpdate(id, !!tagData);
|
|
138
141
|
|
|
139
142
|
return sectionText ? (
|
|
140
|
-
<InternalSideNavigationGroupTrigger
|
|
143
|
+
<InternalSideNavigationGroupTrigger
|
|
144
|
+
{...rest}
|
|
145
|
+
id={id}
|
|
146
|
+
title={sectionText}
|
|
147
|
+
isActive={undefined}
|
|
148
|
+
tag={tagData}
|
|
149
|
+
className={className}
|
|
150
|
+
/>
|
|
141
151
|
) : null;
|
|
142
152
|
};
|
|
143
153
|
|
|
144
|
-
|
|
154
|
+
function ProfileDropdownLink(props: ProfileDropdownLinkProps) {
|
|
145
155
|
const { breakpoint, NavigationComponent } = useTitanLayoutContext();
|
|
146
156
|
return breakpoint.isMobile ? (
|
|
147
157
|
<MobileProfileDropdownLink {...props} navigationComponent={NavigationComponent} />
|
|
148
158
|
) : (
|
|
149
159
|
<DesktopProfileDropdown.Link {...props} />
|
|
150
160
|
);
|
|
151
|
-
}
|
|
161
|
+
}
|
|
152
162
|
const MobileProfileDropdownLink: FC<ProfileDropdownLinkProps & NavigationComponentProps> = ({
|
|
163
|
+
id,
|
|
153
164
|
external,
|
|
154
165
|
to,
|
|
155
166
|
tooltip,
|
|
156
167
|
text,
|
|
157
168
|
children,
|
|
169
|
+
className,
|
|
158
170
|
navigationComponent,
|
|
159
|
-
|
|
171
|
+
tag,
|
|
172
|
+
counter,
|
|
173
|
+
...rest
|
|
160
174
|
}) => {
|
|
161
175
|
const { onNotificationsUpdate } = useNotificationsContext();
|
|
162
176
|
const linkText = getText(children, text);
|
|
163
177
|
const isExternalLink = external ?? to?.startsWith('http');
|
|
164
|
-
|
|
178
|
+
const tagData = getCounterTag(counter, tag);
|
|
179
|
+
onNotificationsUpdate(id, !!tagData);
|
|
165
180
|
|
|
166
181
|
return linkText ? (
|
|
167
182
|
<InternalSideNavigationGroupLink
|
|
168
|
-
{...
|
|
183
|
+
{...rest}
|
|
184
|
+
id={id}
|
|
169
185
|
to={to}
|
|
170
186
|
title={linkText}
|
|
187
|
+
isActive={undefined}
|
|
188
|
+
className={className}
|
|
189
|
+
tag={tagData}
|
|
171
190
|
parentId={profileId}
|
|
172
191
|
navigationComponent={isExternalLink ? ExternalNavComponent : navigationComponent}
|
|
173
192
|
/>
|
|
174
193
|
) : null;
|
|
175
194
|
};
|
|
176
195
|
|
|
177
|
-
export const ProfileDropdown = Object.assign(
|
|
196
|
+
export const ProfileDropdown = Object.assign(ProfileDropdownComponent, {
|
|
178
197
|
Divider: ProfileDropdownDivider,
|
|
179
198
|
Link: ProfileDropdownLink,
|
|
180
199
|
Section: ProfileDropdownSection,
|