Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
DropdownMenu: add knob to toggle the button tooltip (useful to test t…
…he bugfix)
  • Loading branch information
ciampo committed Aug 19, 2022
commit f5facc67954785fb59de307c8eb40d61bdc44db1
15 changes: 13 additions & 2 deletions packages/components/src/dropdown-menu/stories/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { text } from '@storybook/addon-knobs';
import { text, boolean } from '@storybook/addon-knobs';

/**
* Internal dependencies
Expand All @@ -25,6 +25,10 @@ export const _default = () => {
const label = text( 'Label', 'Select a direction.' );
const firstMenuItemLabel = text( 'First Menu Item Label', 'Up' );
const secondMenuItemLabel = text( 'First Menu Item Label', 'Down' );
const toggleButtonTootip = boolean(
'Show tooltip on a toggle button',
true
);

const controls = [
{
Expand All @@ -37,5 +41,12 @@ export const _default = () => {
},
];

return <DropdownMenu icon={ menu } label={ label } controls={ controls } />;
return (
<DropdownMenu
icon={ menu }
label={ label }
controls={ controls }
toggleProps={ { showTooltip: toggleButtonTootip } }
/>
);
};