Add Headless Search to Storybook

release
Etienne Lemay 2017-09-27 22:20:56 -04:00
parent 9665c5d8fc
commit 648823c761
1 changed files with 11 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withKnobs, text, boolean, number, select, color } from '@storybook/addon-knobs';
import { Picker, Emoji } from '../src';
import { Picker, Emoji, emojiIndex } from '../src';
import '../css/emoji-mart.css';
const SETS = ['apple', 'google', 'twitter', 'emojione', 'messenger', 'facebook']
@ -52,3 +52,13 @@ storiesOf('Emoji', module)
skin={number('Skin tone', 1)}
/>
));
storiesOf('Headless Search', module)
.addDecorator(withKnobs)
.add('default', () => (
<div>
{emojiIndex.search(text('Search', 'christmas')).map((o) => {
return <span style={{ fontSize: '2em', marginLeft: '.2em' }}>{o.native}</span>
})}
</div>
));