Skip to content

Commit

Permalink
fix(Tab): relax menuItem prop type
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Jun 30, 2017
1 parent dbc3b00 commit e901148
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
19 changes: 19 additions & 0 deletions docs/app/Examples/modules/Tab/Usage/TabExampleCustomMenuItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react'
import { Label, Menu, Tab } from 'semantic-ui-react'

const panes = [
{
menuItem: { icon: 'users', content: 'Users' },
render: () => <Tab.Pane>Tab 1 Content</Tab.Pane>,
},
{
menuItem: <Menu.Item>Messages<Label>15</Label></Menu.Item>,
render: () => <Tab.Pane>Tab 2 Content</Tab.Pane>,
},
]

const TabExampleCustomMenuItem = () => (
<Tab panes={panes} />
)

export default TabExampleCustomMenuItem
5 changes: 5 additions & 0 deletions docs/app/Examples/modules/Tab/Usage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const TabUsageExamples = () => (
description='You can capture the tab change event.'
examplePath='modules/Tab/Usage/TabExampleOnTabChange'
/>
<ComponentExample
title='Custom Menu Items'
description='You can pass any shorthand value as a menu item.'
examplePath='modules/Tab/Usage/TabExampleCustomMenuItem'
/>
</ExampleSection>
)

Expand Down
2 changes: 1 addition & 1 deletion src/modules/Tab/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Tab extends Component {
* }
*/
panes: PropTypes.arrayOf(PropTypes.shape({
menuItem: PropTypes.string.isRequired,
menuItem: customPropTypes.itemShorthand,
render: PropTypes.func.isRequired,
})),
}
Expand Down

0 comments on commit e901148

Please sign in to comment.