DocSpace-client/web/ASC.Web.Storybook/stories/contxt-menu-button/contxt-menu-button.stories.js

32 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-06-24 13:50:54 +00:00
import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs, text, select, number, color, boolean } from '@storybook/addon-knobs/react';
2019-06-24 13:50:54 +00:00
import withReadme from 'storybook-readme/with-readme';
import Readme from './README.md';
import Section from '../../.storybook/decorators/section';
2019-06-26 14:29:18 +00:00
import { ContextMenuButton, Icons } from 'asc-web-components';
2019-06-24 13:50:54 +00:00
2019-06-26 14:29:18 +00:00
const iconNames = Object.keys(Icons);
2019-06-24 13:50:54 +00:00
function getData() {
console.log('getData');
return [
{key: 'key1', label: 'label1', onClick: () => console.log('label1')},
{key: 'key2', label: 'label2', onClick: () => console.log('label2')}
]
}
storiesOf('Components|ContextMenuButton', module)
2019-06-25 09:02:44 +00:00
.addDecorator(withKnobs)
2019-06-24 13:50:54 +00:00
.addDecorator(withReadme(Readme))
.add('base', () => (
2019-06-24 13:50:54 +00:00
<Section>
2019-06-25 09:02:44 +00:00
<ContextMenuButton
title={text('title', 'Actions')}
2019-06-26 14:29:18 +00:00
iconName={select('iconName', iconNames, 'VerticalDotsIcon')}
size={number('size', 16)}
2019-06-25 09:02:44 +00:00
color={color('loaderColor', '#A3A9AE')}
getData={getData}
isDisabled={boolean("isDisabled", false)} />
2019-06-24 13:50:54 +00:00
</Section>
));