2020-02-17 12:14:56 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
import { KeyboardRegistry } from 'react-native-keyboard-input';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import store from '../../lib/createStore';
|
|
|
|
import EmojiPicker from '../EmojiPicker';
|
|
|
|
import styles from './styles';
|
|
|
|
import { themes } from '../../constants/colors';
|
|
|
|
import { withTheme } from '../../theme';
|
|
|
|
|
|
|
|
export default class EmojiKeyboard extends React.PureComponent {
|
|
|
|
static propTypes = {
|
|
|
|
theme: PropTypes.string
|
|
|
|
};
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
const state = store.getState();
|
2020-07-08 16:19:41 +00:00
|
|
|
this.baseUrl = state.share.server || state.server.server;
|
2020-02-17 12:14:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onEmojiSelected = (emoji) => {
|
|
|
|
KeyboardRegistry.onItemSelected('EmojiKeyboard', { emoji });
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { theme } = this.props;
|
|
|
|
return (
|
|
|
|
<View style={[styles.emojiKeyboardContainer, { borderTopColor: themes[theme].borderColor }]} testID='messagebox-keyboard-emoji'>
|
|
|
|
<EmojiPicker onEmojiSelected={this.onEmojiSelected} baseUrl={this.baseUrl} />
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KeyboardRegistry.registerKeyboard('EmojiKeyboard', () => withTheme(EmojiKeyboard));
|