Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DropdownButton Component #11

Merged
merged 2 commits into from
Jul 10, 2018
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
4 changes: 4 additions & 0 deletions components/DropdownButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import React, {Component} from 'react';
import {DropdownButton} from 'react-bootstrap';

export default DropdownButton;
2 changes: 2 additions & 0 deletions components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import AlertDismissable from './AlertDismissable';
import Badge from './Badge';
import Breadcrumb from './Breadcrumb';
import Button from './Button';
import DropdownButton from './DropdownButton';
import Label from './Label';
import Modal from './Modal';

Expand All @@ -10,6 +11,7 @@ export {
Badge,
Breadcrumb,
Button,
DropdownButton,
Label,
Modal,
};
35 changes: 32 additions & 3 deletions stories/index.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {ButtonGroup} from 'react-bootstrap';
import {ButtonGroup, MenuItem} from 'react-bootstrap';
import {storiesOf, addDecorator} from '@storybook/react';
import {action} from '@storybook/addon-actions';
import {linkTo} from '@storybook/addon-links';
Expand All @@ -10,18 +10,19 @@ import {
Badge,
Button,
Breadcrumb,
DropdownButton,
Label,
Modal,
} from '../components';

import '../less/styles.less';

const margins = {
margin: '5px 100px 10px 5px',
margin: '5px 100px 10px 5px',
};
const MarginDecorator = (storyFn) => (
<div style={margins}>
{ storyFn() }
{storyFn()}
</div>
);
addDecorator(MarginDecorator);
Expand Down Expand Up @@ -143,6 +144,34 @@ storiesOf('Buttons', module)
</div>
)));

storiesOf('Dropdown Button', module)
.add('Default', withInfo('')(() => (
<div>
<DropdownButton
bsStyle="secondary"
title="Actions"
>
<MenuItem eventKey="1">{'Merge'}</MenuItem>
<MenuItem eventKey="2">{'Delete'}</MenuItem>
<MenuItem active eventKey="3">
{'Add ISRC Code'}
</MenuItem>
<MenuItem divider />
<MenuItem eventKey="4">{'Let it be'}</MenuItem>
</DropdownButton>
</div>
)))

.add('Disabled Dropdown', withInfo('')(() => (
<div>
<DropdownButton
bsStyle="secondary"
disabled
title="Actions"
/>
</div>
)));

storiesOf('Label', module)
.add('Default', withInfo('')(() => (
<div>
Expand Down