,
+ items: [
+ {
+ label: "English",
+ name: "EN",
+ onClick: action("English selected")
+ }
+ ]
},
{
- label: "Onboarding",
- onClick: action("Onboarding clicked"),
- "data-cy": "Onboarding"
- }
-];
-
-const user = {
- name: "Carlito",
- actions: [
- { label: "Log out", onClick: action("Logout clicked"), "data-cy": "Logout" }
- ]
-};
-
-const languages = [
+ type: "dropdown",
+ icon: ,
+ items: [
+ { label: "Hyperdrive UI", onClick: action("Hyperdrive UI clicked") }
+ ]
+ },
{
- label: "Français",
- name: "FR",
- onClick: action("French selected"),
- selected: false
+ type: "dropdown",
+ icon: ,
+ items: [
+ { label: "About", onClick: action("About clicked") },
+ { label: "Documentation", onClick: action("Documentation clicked") },
+ { label: "Onboarding", onClick: action("Onboarding clicked") }
+ ]
},
{
- label: "English",
- name: "EN",
- onClick: action("English selected"),
- selected: true
+ type: "dropdown",
+ text: "Carlito",
+ icon: ,
+ items: [{ label: "Log out", onClick: action("Logout clicked") }]
}
];
storiesOf("Layout", module)
.addDecorator(withKnobs)
.add("Sidebar docked", () => {
- const toggle = boolean("Sidebar Toogle Visible", true);
const expanded = boolean("Sidebar Expanded", false);
const sidebar = {
@@ -85,12 +77,8 @@ storiesOf("Layout", module)
const navbar = {
onToggleClick: action("toggle clicked"),
- toggleVisible: toggle,
productName: "Harware UI",
- languages,
- applications,
- help,
- user
+ rightActions
};
return (
@@ -107,12 +95,8 @@ storiesOf("Layout", module)
const navbar = {
onToggleClick: action("toggle clicked"),
- toggleVisible: true,
productName: "Harware UI",
- languages,
- applications,
- help,
- user
+ rightActions
};
return (
diff --git a/stories/navbar.js b/stories/navbar.js
index bf69adb785..894ca064fb 100644
--- a/stories/navbar.js
+++ b/stories/navbar.js
@@ -4,21 +4,6 @@ import Navbar from "../src/lib/components/navbar/Navbar.component";
import { action } from "@storybook/addon-actions";
import { storiesOf } from "@storybook/react";
-const applications = [
- { label: "Hyperdrive UI", onClick: action("Hyperdrive UI clicked") }
-];
-
-const help = [
- { label: "About", onClick: action("About clicked") },
- { label: "Documentation", onClick: action("Documentation clicked") },
- { label: "Onboarding", onClick: action("Onboarding clicked") }
-];
-
-const user = {
- name: "Carlito",
- actions: [{ label: "Log out", onClick: action("Logout clicked") }]
-};
-
const tabs = [
{
selected: true,
@@ -47,18 +32,45 @@ const tabs = [
}
];
-const languages = [
+const rightActions = [
+ {
+ type: "dropdown",
+ text: "FR",
+ icon: ,
+ items: [
+ {
+ label: "English",
+ name: "EN",
+ onClick: action("English selected")
+ }
+ ]
+ },
+ {
+ type: "dropdown",
+ icon: ,
+ items: [
+ { label: "Hyperdrive UI", onClick: action("Hyperdrive UI clicked") }
+ ]
+ },
{
- label: "Français",
- name: "FR",
- onClick: action("French selected"),
- selected: false
+ type: "dropdown",
+ icon: ,
+ items: [
+ { label: "About", onClick: action("About clicked") },
+ { label: "Documentation", onClick: action("Documentation clicked") },
+ { label: "Onboarding", onClick: action("Onboarding clicked") }
+ ]
},
{
- label: "English",
- name: "EN",
- onClick: action("English selected"),
- selected: true
+ type: "button",
+ icon: ,
+ onClick: action("Theme toggle clicked")
+ },
+ {
+ type: "dropdown",
+ text: "Carlito",
+ icon: ,
+ items: [{ label: "Log out", onClick: action("Logout clicked") }]
}
];
@@ -68,39 +80,26 @@ storiesOf("Navbar", module).add("Default", () => {
Navbar with toggle
Navbar without toggle
Navbar with customized logo
}
tabs={tabs}
/>
Navbar with only tabs
-
+
);
});