From b8abf0a31025a2b64d738f96c08bf91c276d8d63 Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Sun, 23 Apr 2017 15:32:03 +0200 Subject: [PATCH] =?UTF-8?q?Make=20example=20much=20more=20performant=20-?= =?UTF-8?q?=20Don=E2=80=99t=20load=20all=20sets=20spritesheet=20-=20Handle?= =?UTF-8?q?=20native=20like=20the=20other=20sets,=20and=20use=20native=20b?= =?UTF-8?q?y=20default=20(no=20spritesheet=20load)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/index.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/example/index.js b/example/index.js index d3e25cc..cdd7952 100644 --- a/example/index.js +++ b/example/index.js @@ -10,7 +10,7 @@ class Example extends React.Component { emojiSize: 24, perLine: 9, skin: 1, - native: false, + native: true, set: 'apple', hidden: false, } @@ -46,19 +46,25 @@ class Example extends React.Component {
- {['apple', 'google', 'twitter', 'emojione'].map((set) => { - var props = { disabled: set == this.state.set } + {['native', 'apple', 'google', 'twitter', 'emojione'].map((set) => { + var props = { disabled: !this.state.native && set == this.state.set } + + if (set == 'native' && this.state.native) { + props.disabled = true + } return })}
@@ -82,7 +88,6 @@ class Example extends React.Component {
emojiSize={{this.state.emojiSize}}
perLine={{this.state.perLine}} {this.state.perLine < 10 ? ' ' : ' '}
skin={{this.state.skin}} -
native={{this.state.native ? 'true' : 'false'}}{this.state.native ? ' ' : ''}
set='{this.state.set}'
onClick={(emoji) => console.log(emoji)}
/>