forked from brendan-rius/react-native-emoji-keyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmojiKeyboard.js
48 lines (40 loc) · 1.2 KB
/
EmojiKeyboard.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from 'react'
import PropTypes from 'prop-types'
import {requireNativeComponent} from 'react-native'
export default class EmojiKeyboard extends React.PureComponent {
static propTypes = {
/**
* Called when the user pressed on an emoji
*/
onEmojiPicked: PropTypes.func,
/**
* Called when a user removed an emoji by pressing on the delete button of the keyboard.
* The delete button must be visible for this to work
*/
onEmojiRemoved: PropTypes.func,
/**
* Should the view keyboard have a delete button?
*/
showDeleteButton: PropTypes.bool,
bgColor: PropTypes.string,
style: PropTypes.any,
}
static defaultProps = {
onEmojiPicked : () => null,
onEmojiRemoved : () => null,
showDeleteButton: true,
bgColor : 'rgba(249, 249, 249, 0)'
}
render() {
return (
<RCTEmojiKeyboard
style={[{height: 236, alignSelf: 'stretch'}, this.props.style]}
onEmojiPicked={e => this.props.onEmojiPicked(e.nativeEvent.emoji)}
onEmojiRemoved={() => this.props.onEmojiRemoved()}
bgColor={this.props.bgColor}
showDeleteButton={this.props.showDeleteButton}
/>
);
}
}
const RCTEmojiKeyboard = requireNativeComponent('RNEmojiKeyboard', EmojiKeyboard)