@dilicorp/ui 0.2.9 → 0.2.10
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.
|
@@ -22,8 +22,9 @@ export const SideNavigationBarItem = (props) => {
|
|
|
22
22
|
const { className = '', items, index, pathname = '' } = props, attrs = __rest(props, ["className", "items", "index", "pathname"]);
|
|
23
23
|
const [active, setActive] = useState(false);
|
|
24
24
|
const sanitizedHref = ((attrs === null || attrs === void 0 ? void 0 : attrs.href) ? (_a = attrs === null || attrs === void 0 ? void 0 : attrs.href) === null || _a === void 0 ? void 0 : _a.split('?')[0] : '/').split('/')[1];
|
|
25
|
+
const sanitizedPath = pathname === null || pathname === void 0 ? void 0 : pathname.split('/')[1];
|
|
25
26
|
const isHomePage = (sanitizedHref === '' && pathname === '/');
|
|
26
|
-
const isPathActive = sanitizedHref &&
|
|
27
|
+
const isPathActive = sanitizedHref && sanitizedPath.includes(sanitizedHref);
|
|
27
28
|
const activeClass = isHomePage || isPathActive ? ' active' : '';
|
|
28
29
|
const submenClass = items && items.length > 0 ? ' submenu-li' : ' link-li';
|
|
29
30
|
return (React.createElement("li", { className: `${className}${activeClass}${submenClass}` }, items
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
declare type CardSummaryHeaderProps = {
|
|
3
3
|
label: string;
|
|
4
4
|
href?: string;
|
|
5
|
+
className?: string;
|
|
5
6
|
};
|
|
6
7
|
export declare const CardSummaryHeader: {
|
|
7
|
-
({ label, href }: CardSummaryHeaderProps): JSX.Element;
|
|
8
|
+
({ label, href, className }: CardSummaryHeaderProps): JSX.Element;
|
|
8
9
|
displayName: string;
|
|
9
10
|
};
|
|
10
11
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
|
-
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
export const CardSummaryHeader = ({ label, href, className }) => {
|
|
5
|
+
const classes = classNames('dash-title', className);
|
|
4
6
|
return (React.createElement("div", { className: "dash-header" }, href
|
|
5
7
|
? (React.createElement(Link, { className: "normal-link", to: href },
|
|
6
|
-
React.createElement("div", { className:
|
|
7
|
-
: (React.createElement("div", { className:
|
|
8
|
+
React.createElement("div", { className: classes }, label)))
|
|
9
|
+
: (React.createElement("div", { className: classes }, label))));
|
|
8
10
|
};
|
|
9
11
|
CardSummaryHeader.displayName = 'CardSummaryHeader';
|
|
@@ -10,9 +10,10 @@ export declare const CardSummary: {
|
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
Header: {
|
|
13
|
-
({ label, href }: {
|
|
13
|
+
({ label, href, className }: {
|
|
14
14
|
label: string;
|
|
15
15
|
href?: string | undefined;
|
|
16
|
+
className?: string | undefined;
|
|
16
17
|
}): JSX.Element;
|
|
17
18
|
displayName: string;
|
|
18
19
|
};
|