@irontec/ivoz-ui 1.7.7 → 1.7.8
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.
|
@@ -7,6 +7,7 @@ import useRouteChain from '../../../../hooks/useRouteChain';
|
|
|
7
7
|
import _ from '../../../../services/translations/translate';
|
|
8
8
|
import { StyledCollapsedBreadcrumbsLink, StyledCollapsedBreadcrumbsNavigateNextIcon, StyledCollapsedBreadcrumbsTypography, } from './styles/Links.styles';
|
|
9
9
|
import useParentRow from '../../../../hooks/useParentRow';
|
|
10
|
+
import { useTranslation } from 'react-i18next';
|
|
10
11
|
const getEntityItemLink = (routeItem, match) => {
|
|
11
12
|
var _a;
|
|
12
13
|
const baseUrl = process.env.BASE_URL || '/';
|
|
@@ -21,6 +22,7 @@ const Breadcrumbs = (props) => {
|
|
|
21
22
|
const { routeMap, desktop = true } = props;
|
|
22
23
|
const match = useCurrentPathMatch();
|
|
23
24
|
const formRow = useStoreState((state) => state.form.row);
|
|
25
|
+
const { i18n } = useTranslation();
|
|
24
26
|
const routeItems = useRouteChain({
|
|
25
27
|
routeMap,
|
|
26
28
|
match,
|
|
@@ -56,7 +58,8 @@ const Breadcrumbs = (props) => {
|
|
|
56
58
|
const isLast = key + 1 === routeItems.length;
|
|
57
59
|
const params = Object.values(match.params);
|
|
58
60
|
const entityId = params[key];
|
|
59
|
-
const
|
|
61
|
+
const currentLang = i18n.resolvedLanguage;
|
|
62
|
+
const element = (_jsxs("span", Object.assign({ style: { display: 'flex', gap: '12px' } }, { children: [_jsx(StyledCollapsedBreadcrumbsLink, Object.assign({ to: to }, { children: entity.title })), isLast && entity.link && !appendSegment && (_jsx("a", Object.assign({ target: '_blank', href: entity.link.replace('${language}', currentLang || 'en'), rel: 'noreferrer', style: { height: '24px' } }, { children: _jsx("img", { src: 'assets/img/breadcrumb-link.svg' }) })))] }), key));
|
|
60
63
|
breadcrumbs.push(element);
|
|
61
64
|
if (isLast || !entityId) {
|
|
62
65
|
return;
|