overleaf/services/web/frontend/stories/dropdown.stories.js
Alf Eaton 7c97f8ab6e Switch to new JSX runtime (#4225)
* Use new JSX runtime and update Babel Node target
* Update .eslintrc
* Remove React imports

GitOrigin-RevId: 559de0267f8f2934c56a860ea8701bb522aa861a
2021-06-24 02:06:59 +00:00

45 lines
1.1 KiB
JavaScript

import { Dropdown, MenuItem } from 'react-bootstrap'
import ControlledDropdown from '../js/shared/components/controlled-dropdown'
export const Customized = args => {
return (
<ControlledDropdown
pullRight={args.pullRight}
defaultOpen={args.defaultOpen}
id="dropdown-story"
>
<Dropdown.Toggle
noCaret={args.noCaret}
className={args.className}
bsStyle={args.bsStyle}
>
{args.title}
</Dropdown.Toggle>
<Dropdown.Menu>
<MenuItem eventKey="1">Action</MenuItem>
<MenuItem eventKey="2">Another action</MenuItem>
<MenuItem eventKey="3" active>
Active Item
</MenuItem>
<MenuItem divider />
<MenuItem eventKey="4">Separated link</MenuItem>
</Dropdown.Menu>
</ControlledDropdown>
)
}
Customized.args = {
title: 'Toggle & Menu used separately',
}
export default {
title: 'Dropdown',
component: ControlledDropdown,
args: {
bsStyle: 'default',
title: 'Dropdown',
pullRight: false,
noCaret: false,
className: '',
defaultOpen: true,
},
}