Signed-off-by: kaustubh B <kbawanka@redhat.com>
This commit is contained in:
parent
8efefb2c39
commit
feddb660af
1 changed files with 5 additions and 3 deletions
|
@ -24,6 +24,7 @@ import { useServerInfo } from "../../context/server-info/ServerInfoProvider";
|
||||||
import { PageHandler } from "../../page/PageHandler";
|
import { PageHandler } from "../../page/PageHandler";
|
||||||
import { TAB_PROVIDER } from "../../page/PageList";
|
import { TAB_PROVIDER } from "../../page/PageList";
|
||||||
import useIsFeatureEnabled, { Feature } from "../../utils/useIsFeatureEnabled";
|
import useIsFeatureEnabled, { Feature } from "../../utils/useIsFeatureEnabled";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
// TODO: Remove the custom 'children' props and type once the following issue has been resolved:
|
// TODO: Remove the custom 'children' props and type once the following issue has been resolved:
|
||||||
// https://github.com/patternfly/patternfly-react/issues/6766
|
// https://github.com/patternfly/patternfly-react/issues/6766
|
||||||
|
@ -49,6 +50,7 @@ export const RoutableTabs = ({
|
||||||
const { componentTypes } = useServerInfo();
|
const { componentTypes } = useServerInfo();
|
||||||
const tabs = componentTypes?.[TAB_PROVIDER] || [];
|
const tabs = componentTypes?.[TAB_PROVIDER] || [];
|
||||||
const isFeatureEnabled = useIsFeatureEnabled();
|
const isFeatureEnabled = useIsFeatureEnabled();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const matchedTabs = tabs
|
const matchedTabs = tabs
|
||||||
.filter((tab) => matchPath({ path: tab.metadata.path }, pathname))
|
.filter((tab) => matchPath({ path: tab.metadata.path }, pathname))
|
||||||
|
@ -95,9 +97,9 @@ export const RoutableTabs = ({
|
||||||
>
|
>
|
||||||
{children as any}
|
{children as any}
|
||||||
{isFeatureEnabled(Feature.DeclarativeUI) &&
|
{isFeatureEnabled(Feature.DeclarativeUI) &&
|
||||||
matchedTabs.map<any>((t) => (
|
matchedTabs.map<any>((tab) => (
|
||||||
<DynamicTab key={t.id} eventKey={t.pathname} title={t.id}>
|
<DynamicTab key={tab.id} eventKey={tab.pathname} title={t(tab.id)}>
|
||||||
<PageHandler page={t} providerType={TAB_PROVIDER} />
|
<PageHandler page={tab} providerType={TAB_PROVIDER} />
|
||||||
</DynamicTab>
|
</DynamicTab>
|
||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
Loading…
Reference in a new issue