Add `Get emoji data from Native` story
parent
1c7a5d6ec6
commit
f90defbed7
|
@ -11,7 +11,8 @@ import {
|
|||
color,
|
||||
} 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'
|
||||
|
||||
const SETS = ['apple', 'google', 'twitter', 'emojione', 'messenger', 'facebook']
|
||||
|
@ -214,3 +215,35 @@ storiesOf('Headless Search', module)
|
|||
</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>
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue