Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions website/screens/components/nav-tabs/code/NavTabsCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import basicUsage from "./examples/basicUsage";
import routerLink from "./examples/routerLink";
import routerLinkV6 from "./examples/routerLinkV6";
import nextLink from "./examples/nextLink";
import icons from "./examples/icons";
import TableCode from "@/common/TableCode";
import StatusBadge from "@/common/StatusBadge";

Expand Down Expand Up @@ -287,6 +288,14 @@ const sections = [
},
],
},
{
title: "Icons and notifications",
content: (
<>
<Example example={icons} defaultIsVisible />
</>
),
},
],
},
];
Expand Down
26 changes: 26 additions & 0 deletions website/screens/components/nav-tabs/code/examples/icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { DxcNavTabs, DxcInset } from "@dxc-technology/halstack-react";

const code = `() => {
return (
<DxcInset space="2rem">
<DxcNavTabs iconPosition="left">
<DxcNavTabs.Tab href="#" active icon="favorite" notificationNumber>
Tab 1
</DxcNavTabs.Tab>
<DxcNavTabs.Tab href="#" disabled icon="favorite" notificationNumber={5}>
Tab 2
</DxcNavTabs.Tab>
<DxcNavTabs.Tab href="#" icon="favorite" notificationNumber={120}>
Tab 3
</DxcNavTabs.Tab>
</DxcNavTabs>
</DxcInset>
);
}`;

const scope = {
DxcNavTabs,
DxcInset,
};

export default { code, scope };
2 changes: 1 addition & 1 deletion website/screens/components/tabs/code/TabsCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const sections = [
content: <Example example={uncontrolled} defaultIsVisible />,
},
{
title: "Icons",
title: "Icons and notifications",
content: <Example example={icons} defaultIsVisible />,
},
],
Expand Down
4 changes: 4 additions & 0 deletions website/screens/components/tabs/code/examples/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ const code = `() => {
{
label: "3G Mobile",
icon: mobileIcon,
notificationNumber: true
},
{
label: "Ethernet",
icon: "settings_ethernet",
isDisabled: true,
notificationNumber: 2
},
{
label: "Wifi",
icon: "wifi",
notificationNumber: 120
},
]}
></DxcTabs>
Expand Down