@conduction/components 2.0.11 → 2.0.15
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/README.md +21 -18
- package/lib/components/formFields/input.js +1 -1
- package/lib/components/formFields/select/select.js +3 -3
- package/lib/components/tag/Tag.module.css +0 -1
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.d.ts +1 -0
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.js +13 -3
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.module.css +67 -3
- package/package.json +4 -1
- package/src/components/formFields/select/select.tsx +1 -0
- package/src/components/tag/Tag.module.css +0 -1
- package/src/components/topNav/primaryTopNav/PrimaryTopNav.module.css +67 -3
- package/src/components/topNav/primaryTopNav/PrimaryTopNav.tsx +31 -6
package/README.md
CHANGED
|
@@ -4,34 +4,37 @@
|
|
|
4
4
|
|
|
5
5
|
- **Version 2**
|
|
6
6
|
|
|
7
|
-
- 2.0.
|
|
8
|
-
|
|
7
|
+
- 2.0.15: Added mobile support to PrimaryTopNav;
|
|
8
|
+
- 2.0.14: Refactored SelectCreate placeholder text.
|
|
9
|
+
- 2.0.13: removed round borders of tag.
|
|
10
|
+
- 2.0.11 & 2.0.12:
|
|
11
|
+
- Added disabled state to SelectSingle component.
|
|
9
12
|
- 2.0.10:
|
|
10
|
-
- Added InputFloat (.00 decimals) component
|
|
13
|
+
- Added InputFloat (.00 decimals) component.
|
|
11
14
|
- 2.0.9:
|
|
12
|
-
- Added optional defaultChecked to InputCheckbox
|
|
13
|
-
- Added CreateKeyValue input
|
|
15
|
+
- Added optional defaultChecked to InputCheckbox.
|
|
16
|
+
- Added CreateKeyValue input.
|
|
14
17
|
- Added CreateSelect input.
|
|
15
18
|
- 2.0.8:
|
|
16
19
|
- Added new Tooltip component using React-tooltip.
|
|
17
|
-
- Added active status to PrimaryTopNav
|
|
18
|
-
- Added active status to SecondaryTopNav
|
|
20
|
+
- Added active status to PrimaryTopNav.
|
|
21
|
+
- Added active status to SecondaryTopNav.
|
|
19
22
|
- 2.0.7:
|
|
20
23
|
- Added new BadgeCounter component.
|
|
21
24
|
- Added CodeBlock component.
|
|
22
25
|
- 2.0.6:
|
|
23
|
-
- Added optional icon with default icon to the primary and secondary button in NotificationPopUp
|
|
24
|
-
- Added a handleClick function to the DownloadCard
|
|
25
|
-
- Added clickFunction, layoutClassName and renamed tag to label in the Tag component
|
|
26
|
-
- Edited DetailsCard to accommodate changes made to Tag component
|
|
27
|
-
- Edited RichContentCard to accommodate changes made to Tag component
|
|
28
|
-
- 2.0.5: wrong camelcase in npm publish/build fix
|
|
29
|
-
- 2.0.4: added layoutClassName to InfoCard
|
|
30
|
-
- 2.0.3: Bugfix: --conduction-container typo removed
|
|
31
|
-
- 2.0.2: Refactor SelectSingle formField with optional props
|
|
32
|
-
- 2.0.1: Refactor SecondaryTopNav css module import
|
|
26
|
+
- Added optional icon with default icon to the primary and secondary button in NotificationPopUp.
|
|
27
|
+
- Added a handleClick function to the DownloadCard.
|
|
28
|
+
- Added clickFunction, layoutClassName and renamed tag to label in the Tag component.
|
|
29
|
+
- Edited DetailsCard to accommodate changes made to Tag component.
|
|
30
|
+
- Edited RichContentCard to accommodate changes made to Tag component.
|
|
31
|
+
- 2.0.5: wrong camelcase in npm publish/build fix.
|
|
32
|
+
- 2.0.4: added layoutClassName to InfoCard.
|
|
33
|
+
- 2.0.3: Bugfix: --conduction-container typo removed.
|
|
34
|
+
- 2.0.2: Refactor SelectSingle formField with optional props.
|
|
35
|
+
- 2.0.1: Refactor SecondaryTopNav css module import.
|
|
33
36
|
- 2.0.0: components are now dependent on `--skeleton` design tokens, currently found [here](https://github.com/OpenCatalogi/web-app/blob/development/pwa/src/styling/design-tokens/skeleton-design-tokens.css).
|
|
34
37
|
|
|
35
38
|
- **Version 1**
|
|
36
39
|
|
|
37
|
-
- No changelog available
|
|
40
|
+
- No changelog available.
|
|
@@ -9,6 +9,6 @@ export const InputPassword = ({ disabled, name, validation, register, placeholde
|
|
|
9
9
|
export const InputText = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "text", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
10
10
|
export const InputEmail = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "email", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
11
11
|
export const InputDate = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "date", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
12
|
-
export const InputNumber = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", ...{ disabled, placeholder, icon
|
|
12
|
+
export const InputNumber = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
13
13
|
export const InputFloat = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", step: ".01", ...{ disabled, placeholder, icon, defaultValue }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
14
14
|
export const InputFile = ({ disabled, name, accept, defaultValue, validation, register, }) => (_jsx("input", { className: "denhaag-textfield__input", type: "file", ...{ defaultValue, disabled, accept }, ...register(name, { ...validation }) }));
|
|
@@ -10,11 +10,11 @@ export const SelectMultiple = ({ name, options, errors, control, validation, def
|
|
|
10
10
|
};
|
|
11
11
|
export const SelectCreate = ({ name, options, errors, control, validation, defaultValue, disabled, }) => {
|
|
12
12
|
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
13
|
-
return (_jsx(CreatableSelect, { className: styles.select, isMulti: true, isDisabled: disabled, ...{ options, value, onChange, errors, defaultValue } }));
|
|
13
|
+
return (_jsx(CreatableSelect, { placeholder: "Select existing or create new entries", className: styles.select, isMulti: true, isDisabled: disabled, ...{ options, value, onChange, errors, defaultValue } }));
|
|
14
14
|
} }));
|
|
15
15
|
};
|
|
16
|
-
export const SelectSingle = ({ name, options, errors, control, validation, isClearable, defaultValue, }) => {
|
|
16
|
+
export const SelectSingle = ({ name, options, errors, control, validation, isClearable, defaultValue, disabled, }) => {
|
|
17
17
|
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
18
|
-
return (_jsx(ReactSelect, { className: styles.select, ...{ options, onChange, value, errors, isClearable, defaultValue } }));
|
|
18
|
+
return (_jsx(ReactSelect, { className: styles.select, isDisabled: disabled, ...{ options, onChange, value, errors, isClearable, defaultValue } }));
|
|
19
19
|
} }));
|
|
20
20
|
};
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
font-size: var(--conduction-tag-font-size);
|
|
14
14
|
color: var(--conduction-tag-color);
|
|
15
15
|
background-color: var(--conduction-tag-background-color);
|
|
16
|
-
border-radius: var(--conduction-tag-border-radius);
|
|
17
16
|
padding-inline-start: var(--conduction-tag-padding);
|
|
18
17
|
padding-inline-end: var(--conduction-tag-padding);
|
|
19
18
|
padding-block-start: var(--conduction-tag-padding);
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
import * as styles from "./PrimaryTopNav.module.css";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { Link } from "@gemeente-denhaag/components-react";
|
|
6
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
7
|
+
import { faBars } from "@fortawesome/free-solid-svg-icons";
|
|
8
|
+
export const PrimaryTopNav = ({ items, mobileLogo, layoutClassName }) => {
|
|
9
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
10
|
+
const handleItemClick = (handleClick) => {
|
|
11
|
+
if (handleClick) {
|
|
12
|
+
handleClick();
|
|
13
|
+
setIsOpen(false);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs("div", { className: clsx(styles.container, layoutClassName && layoutClassName), children: [_jsxs("div", { className: styles.menuToggleContainer, children: [mobileLogo, _jsx("button", { className: styles.menuToggle, onClick: () => setIsOpen((o) => !o), children: _jsx(FontAwesomeIcon, { icon: faBars }) })] }), _jsx("nav", { className: clsx(styles.primary, isOpen && styles.isOpen), children: _jsx("ul", { className: styles.ul, children: items.map(({ label, icon, current, handleClick, subItems }, idx) => (_jsxs("li", { className: clsx(styles.li, current && styles.current), children: [_jsx("div", { onClick: () => handleItemClick(handleClick), children: _jsx(Link, { className: styles.link, icon: icon, iconAlign: "start", children: label }) }), subItems && (_jsx("ul", { className: styles.dropdown, children: subItems.map(({ label, icon, current, handleClick }, idx) => (_jsx("li", { className: clsx(styles.li, current && styles.current), onClick: () => handleItemClick(handleClick), children: _jsx(Link, { className: styles.link, icon: icon, iconAlign: "start", children: label }) }, idx))) }))] }, idx))) }) })] }));
|
|
7
17
|
};
|
|
@@ -5,11 +5,46 @@
|
|
|
5
5
|
--conduction-primary-top-nav-background-color-hover: rgba(255, 255, 255, 0.2);
|
|
6
6
|
--conduction-primary-top-nav-dropdown-border-radius: var(--skeleton-border-radius-md);
|
|
7
7
|
--conduction-primary-top-nav-background-color-active: rgba(255, 255, 255, 0.2);
|
|
8
|
+
--conduction-primary-top-nav-toggle-icon-size: 24px;
|
|
9
|
+
--conduction-primary-top-nav-mobile-logo-padding: 18px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.container {
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.menuToggleContainer {
|
|
17
|
+
width: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.menuToggleContainer > button {
|
|
24
|
+
all: unset;
|
|
25
|
+
font-size: var(--conduction-primary-top-nav-toggle-icon-size);
|
|
26
|
+
padding: var(--conduction-primary-top-nav-mobile-logo-padding);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.menuToggleContainer > button:hover {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.primary {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.primary.isOpen {
|
|
38
|
+
display: block;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.menuToggleContainer {
|
|
42
|
+
width: 100%;
|
|
8
43
|
}
|
|
9
44
|
|
|
10
45
|
.primary {
|
|
11
46
|
font-weight: 500;
|
|
12
|
-
width:
|
|
47
|
+
width: 100%;
|
|
13
48
|
background-color: var(--conduction-primary-top-nav-background-color);
|
|
14
49
|
}
|
|
15
50
|
|
|
@@ -19,7 +54,6 @@
|
|
|
19
54
|
|
|
20
55
|
.ul {
|
|
21
56
|
margin: unset;
|
|
22
|
-
display: flex;
|
|
23
57
|
padding-inline-start: unset;
|
|
24
58
|
align-items: center;
|
|
25
59
|
}
|
|
@@ -57,9 +91,39 @@
|
|
|
57
91
|
padding: 0;
|
|
58
92
|
width: 100%;
|
|
59
93
|
display: none;
|
|
60
|
-
position: absolute;
|
|
61
94
|
list-style-type: none;
|
|
62
95
|
background-color: var(--conduction-primary-top-nav-background-color);
|
|
63
96
|
border-bottom-right-radius: var(--conduction-primary-top-nav-dropdown-border-radius);
|
|
64
97
|
border-bottom-left-radius: var(--conduction-primary-top-nav-dropdown-border-radius);
|
|
65
98
|
}
|
|
99
|
+
|
|
100
|
+
.dropdown > li {
|
|
101
|
+
padding-inline-start: var(--web-app-size-md);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media only screen and (min-width: 992px) {
|
|
105
|
+
.container {
|
|
106
|
+
width: fit-content;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.primary {
|
|
110
|
+
display: block;
|
|
111
|
+
width: fit-content;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ul {
|
|
115
|
+
display: flex;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.dropdown {
|
|
119
|
+
position: absolute;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.dropdown > li {
|
|
123
|
+
padding-inline-start: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.menuToggleContainer {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduction/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
4
4
|
"description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/ConductionNL/conduction-components#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"@fortawesome/fontawesome-svg-core": "^6.2.0",
|
|
23
|
+
"@fortawesome/free-solid-svg-icons": "^6.2.0",
|
|
24
|
+
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
22
25
|
"@gemeente-denhaag/components-react": "^0.1.1-alpha.143",
|
|
23
26
|
"@gemeente-denhaag/design-tokens-components": "^0.2.3-alpha.178",
|
|
24
27
|
"@gemeente-denhaag/form-field": "^0.1.1-alpha.67",
|
|
@@ -57,6 +57,7 @@ export const SelectCreate: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
|
57
57
|
render={({ field: { onChange, value } }) => {
|
|
58
58
|
return (
|
|
59
59
|
<CreatableSelect
|
|
60
|
+
placeholder="Select existing or create new entries"
|
|
60
61
|
className={styles.select}
|
|
61
62
|
isMulti
|
|
62
63
|
isDisabled={disabled}
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
font-size: var(--conduction-tag-font-size);
|
|
14
14
|
color: var(--conduction-tag-color);
|
|
15
15
|
background-color: var(--conduction-tag-background-color);
|
|
16
|
-
border-radius: var(--conduction-tag-border-radius);
|
|
17
16
|
padding-inline-start: var(--conduction-tag-padding);
|
|
18
17
|
padding-inline-end: var(--conduction-tag-padding);
|
|
19
18
|
padding-block-start: var(--conduction-tag-padding);
|
|
@@ -5,11 +5,46 @@
|
|
|
5
5
|
--conduction-primary-top-nav-background-color-hover: rgba(255, 255, 255, 0.2);
|
|
6
6
|
--conduction-primary-top-nav-dropdown-border-radius: var(--skeleton-border-radius-md);
|
|
7
7
|
--conduction-primary-top-nav-background-color-active: rgba(255, 255, 255, 0.2);
|
|
8
|
+
--conduction-primary-top-nav-toggle-icon-size: 24px;
|
|
9
|
+
--conduction-primary-top-nav-mobile-logo-padding: 18px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.container {
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.menuToggleContainer {
|
|
17
|
+
width: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.menuToggleContainer > button {
|
|
24
|
+
all: unset;
|
|
25
|
+
font-size: var(--conduction-primary-top-nav-toggle-icon-size);
|
|
26
|
+
padding: var(--conduction-primary-top-nav-mobile-logo-padding);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.menuToggleContainer > button:hover {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.primary {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.primary.isOpen {
|
|
38
|
+
display: block;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.menuToggleContainer {
|
|
42
|
+
width: 100%;
|
|
8
43
|
}
|
|
9
44
|
|
|
10
45
|
.primary {
|
|
11
46
|
font-weight: 500;
|
|
12
|
-
width:
|
|
47
|
+
width: 100%;
|
|
13
48
|
background-color: var(--conduction-primary-top-nav-background-color);
|
|
14
49
|
}
|
|
15
50
|
|
|
@@ -19,7 +54,6 @@
|
|
|
19
54
|
|
|
20
55
|
.ul {
|
|
21
56
|
margin: unset;
|
|
22
|
-
display: flex;
|
|
23
57
|
padding-inline-start: unset;
|
|
24
58
|
align-items: center;
|
|
25
59
|
}
|
|
@@ -57,9 +91,39 @@
|
|
|
57
91
|
padding: 0;
|
|
58
92
|
width: 100%;
|
|
59
93
|
display: none;
|
|
60
|
-
position: absolute;
|
|
61
94
|
list-style-type: none;
|
|
62
95
|
background-color: var(--conduction-primary-top-nav-background-color);
|
|
63
96
|
border-bottom-right-radius: var(--conduction-primary-top-nav-dropdown-border-radius);
|
|
64
97
|
border-bottom-left-radius: var(--conduction-primary-top-nav-dropdown-border-radius);
|
|
65
98
|
}
|
|
99
|
+
|
|
100
|
+
.dropdown > li {
|
|
101
|
+
padding-inline-start: var(--web-app-size-md);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media only screen and (min-width: 992px) {
|
|
105
|
+
.container {
|
|
106
|
+
width: fit-content;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.primary {
|
|
110
|
+
display: block;
|
|
111
|
+
width: fit-content;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ul {
|
|
115
|
+
display: flex;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.dropdown {
|
|
119
|
+
position: absolute;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.dropdown > li {
|
|
123
|
+
padding-inline-start: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.menuToggleContainer {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Link } from "@gemeente-denhaag/components-react";
|
|
3
2
|
import * as styles from "./PrimaryTopNav.module.css";
|
|
4
3
|
import clsx from "clsx";
|
|
4
|
+
import { Link } from "@gemeente-denhaag/components-react";
|
|
5
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
6
|
+
import { faBars } from "@fortawesome/free-solid-svg-icons";
|
|
5
7
|
|
|
6
8
|
interface ITopNavItem {
|
|
7
9
|
label: string;
|
|
@@ -18,17 +20,36 @@ interface ITopNavItem {
|
|
|
18
20
|
|
|
19
21
|
export interface TopNavProps {
|
|
20
22
|
items: ITopNavItem[];
|
|
23
|
+
mobileLogo?: JSX.Element;
|
|
21
24
|
layoutClassName?: string;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
export const PrimaryTopNav: React.FC<TopNavProps> = ({ items, layoutClassName }) => {
|
|
27
|
+
export const PrimaryTopNav: React.FC<TopNavProps> = ({ items, mobileLogo, layoutClassName }) => {
|
|
28
|
+
const [isOpen, setIsOpen] = React.useState<boolean>(false);
|
|
29
|
+
|
|
30
|
+
const handleItemClick = (handleClick?: () => any) => {
|
|
31
|
+
if (handleClick) {
|
|
32
|
+
handleClick();
|
|
33
|
+
|
|
34
|
+
setIsOpen(false);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
25
38
|
return (
|
|
26
|
-
<div className={clsx(styles.
|
|
27
|
-
<
|
|
39
|
+
<div className={clsx(styles.container, layoutClassName && layoutClassName)}>
|
|
40
|
+
<div className={styles.menuToggleContainer}>
|
|
41
|
+
{mobileLogo}
|
|
42
|
+
|
|
43
|
+
<button className={styles.menuToggle} onClick={() => setIsOpen((o) => !o)}>
|
|
44
|
+
<FontAwesomeIcon icon={faBars} />
|
|
45
|
+
</button>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<nav className={clsx(styles.primary, isOpen && styles.isOpen)}>
|
|
28
49
|
<ul className={styles.ul}>
|
|
29
50
|
{items.map(({ label, icon, current, handleClick, subItems }, idx) => (
|
|
30
51
|
<li className={clsx(styles.li, current && styles.current)} key={idx}>
|
|
31
|
-
<div onClick={handleClick}>
|
|
52
|
+
<div onClick={() => handleItemClick(handleClick)}>
|
|
32
53
|
<Link className={styles.link} icon={icon} iconAlign="start">
|
|
33
54
|
{label}
|
|
34
55
|
</Link>
|
|
@@ -37,7 +58,11 @@ export const PrimaryTopNav: React.FC<TopNavProps> = ({ items, layoutClassName })
|
|
|
37
58
|
{subItems && (
|
|
38
59
|
<ul className={styles.dropdown}>
|
|
39
60
|
{subItems.map(({ label, icon, current, handleClick }, idx) => (
|
|
40
|
-
<li
|
|
61
|
+
<li
|
|
62
|
+
key={idx}
|
|
63
|
+
className={clsx(styles.li, current && styles.current)}
|
|
64
|
+
onClick={() => handleItemClick(handleClick)}
|
|
65
|
+
>
|
|
41
66
|
<Link className={styles.link} icon={icon} iconAlign="start">
|
|
42
67
|
{label}
|
|
43
68
|
</Link>
|