From f3f60f58b3b3ac95f27cf22ad6edb9586c5d923f Mon Sep 17 00:00:00 2001 From: Etienne Lemay Date: Tue, 27 Jun 2017 17:24:00 -0400 Subject: [PATCH] Make custom emojis work on example page [Ref #87] --- example/index.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/example/index.js b/example/index.js index 588dd08..0de4f08 100644 --- a/example/index.js +++ b/example/index.js @@ -41,7 +41,7 @@ class Example extends React.Component { native: true, set: 'apple', hidden: false, - currentEmoji: 'thumbsup', + currentEmoji: { id: '+1' }, autoFocus: false, include: [], exclude: [], @@ -182,7 +182,7 @@ class Example extends React.Component { include={this.state.include} exclude={this.state.exclude} onClick={(emoji) => { - this.setState({ currentEmoji: emoji.id }) + this.setState({ currentEmoji: emoji }) console.log(emoji) }} /> @@ -199,14 +199,14 @@ class Example extends React.Component { import {Emoji} from 'emoji-mart'

<Emoji -
emoji='thumbsup' +
emoji={this.state.currentEmoji.custom ? ({'{…}'}) : ('{this.state.currentEmoji.id}')}
size={{64}}
/> {Emoji({ - emoji: this.state.currentEmoji, + emoji: this.state.currentEmoji.custom ? this.state.currentEmoji : this.state.currentEmoji.id, size: 64, set: this.state.set, })} @@ -222,14 +222,14 @@ class Example extends React.Component { width: '370px', }}>
<Emoji -
emoji=':thumbsup:' +
emoji=':{this.state.currentEmoji.id}:'
size={{64}}
/> {Emoji({ - emoji: `:${this.state.currentEmoji}:`, + emoji: `:${this.state.currentEmoji.id}:`, size: 64, set: this.state.set, })} @@ -245,14 +245,14 @@ class Example extends React.Component { width: '370px', }}>
<Emoji -
emoji=':thumbsup::skin-tone-3:' +
emoji=':{this.state.currentEmoji.id}::skin-tone-3:'
size={{64}}
/> {Emoji({ - emoji: `:${this.state.currentEmoji}::skin-tone-3:`, + emoji: `:${this.state.currentEmoji.id}::skin-tone-3:`, size: 64, set: this.state.set, })} @@ -268,7 +268,7 @@ class Example extends React.Component { width: '370px', }}>
<Emoji -
emoji=':thumbsup::skin-tone-3:' +
emoji=':{this.state.currentEmoji.id}::skin-tone-3:'
size={{64}}
native={{'true'}}
/> @@ -276,7 +276,7 @@ class Example extends React.Component { {Emoji({ - emoji: `:${this.state.currentEmoji}::skin-tone-3:`, + emoji: `:${this.state.currentEmoji.id}::skin-tone-3:`, size: 64, native: true, })}