Add `Get emoji data from Native` story

release
Peder Johnsen 2018-11-29 16:09:28 +00:00
parent 1c7a5d6ec6
commit f90defbed7
1 changed files with 34 additions and 1 deletions

View File

@ -11,7 +11,8 @@ import {
color, color,
} from '@storybook/addon-knobs' } from '@storybook/addon-knobs'
import { Picker, Emoji, emojiIndex } from '../dist' import { Picker, Emoji, emojiIndex, getEmojiDataFromNative } from '../dist'
import data from '../data/all.json'
import '../css/emoji-mart.css' import '../css/emoji-mart.css'
const SETS = ['apple', 'google', 'twitter', 'emojione', 'messenger', 'facebook'] const SETS = ['apple', 'google', 'twitter', 'emojione', 'messenger', 'facebook']
@ -214,3 +215,35 @@ storiesOf('Headless Search', module)
</div> </div>
) )
}) })
storiesOf('Get emoji data from Native', module)
.addDecorator(withKnobs)
.add('Default', () => {
let emojiData = getEmojiDataFromNative(
text('Unicode', '🤾🏽‍♂️'),
select('Emoji pack', SETS, SETS[0]),
data
)
if (!emojiData) {
return (
<div>
Couldn't find emojiData from native string...
</div>
)
}
return (
<div>
<Emoji
skin={emojiData.skin || null}
set={select('Emoji pack', SETS, SETS[0])}
emoji={emojiData}
size={48}
/>
<pre>
emojiData: {JSON.stringify(emojiData, null, 2)}
</pre>
</div>
)
})