2018-02-08 14:08:50 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
import { KeyboardRegistry } from 'react-native-keyboard-input';
|
2018-09-11 16:32:52 +00:00
|
|
|
|
2018-02-08 14:08:50 +00:00
|
|
|
import store from '../../lib/createStore';
|
|
|
|
import EmojiPicker from '../EmojiPicker';
|
|
|
|
import styles from './styles';
|
|
|
|
|
|
|
|
export default class EmojiKeyboard extends React.PureComponent {
|
2018-09-11 16:32:52 +00:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
const state = store.getState();
|
|
|
|
this.baseUrl = state.settings.Site_Url || state.server ? state.server.server : '';
|
|
|
|
}
|
2018-09-25 19:28:42 +00:00
|
|
|
|
2018-02-08 14:08:50 +00:00
|
|
|
onEmojiSelected = (emoji) => {
|
|
|
|
KeyboardRegistry.onItemSelected('EmojiKeyboard', { emoji });
|
|
|
|
}
|
2018-09-25 19:28:42 +00:00
|
|
|
|
2018-02-08 14:08:50 +00:00
|
|
|
render() {
|
|
|
|
return (
|
2018-09-11 16:32:52 +00:00
|
|
|
<View style={styles.emojiKeyboardContainer} testID='messagebox-keyboard-emoji'>
|
|
|
|
<EmojiPicker onEmojiSelected={emoji => this.onEmojiSelected(emoji)} baseUrl={this.baseUrl} />
|
|
|
|
</View>
|
2018-02-08 14:08:50 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KeyboardRegistry.registerKeyboard('EmojiKeyboard', () => EmojiKeyboard);
|