2020-02-17 12:14:56 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
2020-12-01 11:58:51 +00:00
|
|
|
import { KeyboardRegistry } from 'react-native-ui-lib/keyboard';
|
2022-08-08 18:38:01 +00:00
|
|
|
import { Provider } from 'react-redux';
|
2020-02-17 12:14:56 +00:00
|
|
|
|
2022-08-08 18:38:01 +00:00
|
|
|
import store from '../../lib/store';
|
2020-02-17 12:14:56 +00:00
|
|
|
import EmojiPicker from '../EmojiPicker';
|
|
|
|
import styles from './styles';
|
2022-04-07 14:10:03 +00:00
|
|
|
import { themes } from '../../lib/constants';
|
2022-08-08 18:38:01 +00:00
|
|
|
import { TSupportedThemes } from '../../theme';
|
2020-02-17 12:14:56 +00:00
|
|
|
|
2022-08-08 18:38:01 +00:00
|
|
|
const EmojiKeyboard = ({ theme }: { theme: TSupportedThemes }) => {
|
|
|
|
const onEmojiSelected = (emoji: string) => {
|
2020-02-17 12:14:56 +00:00
|
|
|
KeyboardRegistry.onItemSelected('EmojiKeyboard', { emoji });
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-02-17 12:14:56 +00:00
|
|
|
|
2022-08-08 18:38:01 +00:00
|
|
|
return (
|
|
|
|
<Provider store={store}>
|
2021-09-13 20:41:05 +00:00
|
|
|
<View
|
|
|
|
style={[styles.emojiKeyboardContainer, { borderTopColor: themes[theme].borderColor }]}
|
|
|
|
testID='messagebox-keyboard-emoji'>
|
2022-08-08 18:38:01 +00:00
|
|
|
<EmojiPicker onEmojiSelected={onEmojiSelected} theme={theme} />
|
2020-02-17 12:14:56 +00:00
|
|
|
</View>
|
2022-08-08 18:38:01 +00:00
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
KeyboardRegistry.registerKeyboard('EmojiKeyboard', () => EmojiKeyboard);
|