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-06-24 20:51:19 +00:00
|
|
|
import {useTheme} from '../../theme'
|
|
|
|
import { EventTypes } from '../EmojiPicker/interfaces';
|
2020-02-17 12:14:56 +00:00
|
|
|
|
2022-06-24 20:51:19 +00:00
|
|
|
const EmojiKeyboard = () => {
|
|
|
|
const onItemClicked = (eventType: EventTypes, emoji: string | undefined) => {
|
|
|
|
KeyboardRegistry.onItemSelected('EmojiKeyboard', { eventType, emoji });
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-02-17 12:14:56 +00:00
|
|
|
|
2022-06-24 20:51:19 +00:00
|
|
|
const {colors} = useTheme()
|
|
|
|
|
2022-08-08 18:38:01 +00:00
|
|
|
return (
|
|
|
|
<Provider store={store}>
|
2021-09-13 20:41:05 +00:00
|
|
|
<View
|
2022-06-24 20:51:19 +00:00
|
|
|
style={[styles.emojiKeyboardContainer, { borderTopColor: colors.borderColor }]}
|
2022-08-08 21:02:08 +00:00
|
|
|
testID='messagebox-keyboard-emoji'
|
|
|
|
>
|
2022-06-28 15:18:19 +00:00
|
|
|
<EmojiPicker onItemClicked={onItemClicked} isEmojiKeyboard={true} />
|
2020-02-17 12:14:56 +00:00
|
|
|
</View>
|
2022-08-08 18:38:01 +00:00
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
KeyboardRegistry.registerKeyboard('EmojiKeyboard', () => EmojiKeyboard);
|