Skip to content

Commit

Permalink
docs(dropdown,combobox): remove itemToElement examples (#5748)
Browse files Browse the repository at this point in the history
* chore(project): sync generated files

* docs(dropdown,combobox): remove itemToElement examples

Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
joshblack and tw15egan authored Apr 3, 2020
1 parent 4599048 commit af0626b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
28 changes: 0 additions & 28 deletions packages/react/src/components/ComboBox/ComboBox-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ const props = () => ({
onChange: action('onChange'),
});

const itemToElement = item => {
const itemAsArray = item.text.split(' ');
return (
<div>
<span>{itemAsArray[0]}</span>
<span style={{ color: 'blue' }}> {itemAsArray[1]}</span>
</div>
);
};

const ControlledComboBoxApp = props => {
const [selectedItem, setSelectedItem] = useState(items[0]);
let uid = items.length;
Expand Down Expand Up @@ -119,24 +109,6 @@ storiesOf('ComboBox', module)
},
}
)
.add(
'items as components',
() => (
<div style={{ width: 300 }}>
<ComboBox
items={items}
itemToString={item => (item ? item.text : '')}
itemToElement={itemToElement}
{...props()}
/>
</div>
),
{
info: {
text: 'ComboBox',
},
}
)
.add(
'application-level control for selection',
() => <ControlledComboBoxApp {...props()} />,
Expand Down
34 changes: 0 additions & 34 deletions packages/react/src/components/Dropdown/Dropdown-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,6 @@ const props = () => ({
),
});

const itemToElement = item => {
const [first, ...rest] = item.text.split(' ');
return (
<div
style={{
textOverflow: 'ellipsis',
overflow: 'hidden',
whiteSpace: 'nowrap',
}}>
<span>{first}</span>
<span style={{ color: 'blue' }}> {rest.join(' ')}</span>
</div>
);
};

storiesOf('Dropdown', module)
.addDecorator(withKnobs)
.add(
Expand Down Expand Up @@ -124,25 +109,6 @@ storiesOf('Dropdown', module)
},
}
)
.add(
'items as components',
() => (
<div style={{ width: 300 }}>
<Dropdown
{...props()}
items={items}
itemToString={item => (item ? item.text : '')}
itemToElement={itemToElement}
onChange={action('onChange')}
/>
</div>
),
{
info: {
text: `Rendering items as custom components`,
},
}
)
.add(
'fully controlled',
() => (
Expand Down

0 comments on commit af0626b

Please sign in to comment.