@visns-studio/visns-components 3.6.0 → 3.6.2
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,8 +3,36 @@ import { Link } from 'react-router-dom';
|
|
|
3
3
|
import { CircleChevronRight } from 'akar-icons';
|
|
4
4
|
|
|
5
5
|
function Breadcrumb({ data, page }) {
|
|
6
|
+
const getNestedData = (data, keys) =>
|
|
7
|
+
keys.reduce((acc, key) => (acc && acc[key] ? acc[key] : null), data);
|
|
8
|
+
|
|
6
9
|
return (
|
|
7
10
|
<h1>
|
|
11
|
+
{page?.parentTitle && page?.parentUrl && (
|
|
12
|
+
<>
|
|
13
|
+
<Link to={page.parentUrl}>
|
|
14
|
+
{page.parentTitle}{' '}
|
|
15
|
+
<CircleChevronRight strokeWidth={2} size={18} />
|
|
16
|
+
</Link>
|
|
17
|
+
|
|
18
|
+
{data &&
|
|
19
|
+
page.parentTitleKey &&
|
|
20
|
+
getNestedData(data, page.parentTitleKey) ? (
|
|
21
|
+
<Link
|
|
22
|
+
to={`${page.parentUrl}/${getNestedData(
|
|
23
|
+
data,
|
|
24
|
+
page.parentUrlKey
|
|
25
|
+
)}`}
|
|
26
|
+
>
|
|
27
|
+
{getNestedData(data, page.parentTitleKey)}
|
|
28
|
+
<CircleChevronRight
|
|
29
|
+
strokeWidth={2}
|
|
30
|
+
size={18}
|
|
31
|
+
/>{' '}
|
|
32
|
+
</Link>
|
|
33
|
+
) : null}
|
|
34
|
+
</>
|
|
35
|
+
)}
|
|
8
36
|
<Link to={page && page.previousUrl ? page.previousUrl : null}>
|
|
9
37
|
{page && page.title ? page.title : null}
|
|
10
38
|
</Link>{' '}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Briefcase,
|
|
8
8
|
Bug,
|
|
9
9
|
Calendar,
|
|
10
|
+
CHatDots,
|
|
10
11
|
Clipboard,
|
|
11
12
|
DoubleSword,
|
|
12
13
|
Draft,
|
|
@@ -38,6 +39,7 @@ import {
|
|
|
38
39
|
TextAlignLeft,
|
|
39
40
|
Ticket,
|
|
40
41
|
Utensils,
|
|
42
|
+
ChatDots,
|
|
41
43
|
} from 'akar-icons';
|
|
42
44
|
|
|
43
45
|
import CustomFetch from './Fetch';
|
|
@@ -122,6 +124,7 @@ function Navigation({
|
|
|
122
124
|
bookOpen: BookOpen,
|
|
123
125
|
briefcase: Briefcase,
|
|
124
126
|
calendar: Calendar,
|
|
127
|
+
chatDots: ChatDots,
|
|
125
128
|
clipboard: Clipboard,
|
|
126
129
|
doubleSword: DoubleSword,
|
|
127
130
|
draft: Draft,
|
package/package.json
CHANGED