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
|
|
|
|
2024-01-25 14:11:07 +00:00
|
|
|
import store from '../../../lib/store';
|
|
|
|
import EmojiPicker from '../../EmojiPicker';
|
|
|
|
import { ThemeContext, TSupportedThemes } from '../../../theme';
|
|
|
|
import { EventTypes } from '../../EmojiPicker/interfaces';
|
|
|
|
import { IEmoji } from '../../../definitions';
|
|
|
|
import { colors } from '../../../lib/constants';
|
2020-02-17 12:14:56 +00:00
|
|
|
|
2022-08-08 18:38:01 +00:00
|
|
|
const EmojiKeyboard = ({ theme }: { theme: TSupportedThemes }) => {
|
2022-10-21 18:27:55 +00:00
|
|
|
const onItemClicked = (eventType: EventTypes, emoji?: IEmoji) => {
|
|
|
|
KeyboardRegistry.onItemSelected('EmojiKeyboard', { eventType, 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}>
|
2022-10-21 18:27:55 +00:00
|
|
|
<ThemeContext.Provider
|
|
|
|
value={{
|
|
|
|
theme,
|
|
|
|
colors: colors[theme]
|
|
|
|
}}
|
2022-08-08 21:02:08 +00:00
|
|
|
>
|
2024-01-25 14:11:07 +00:00
|
|
|
<View style={{ flex: 1 }} testID='message-composer-keyboard-emoji'>
|
2022-10-21 18:27:55 +00:00
|
|
|
<EmojiPicker onItemClicked={onItemClicked} isEmojiKeyboard={true} />
|
|
|
|
</View>
|
|
|
|
</ThemeContext.Provider>
|
2022-08-08 18:38:01 +00:00
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
KeyboardRegistry.registerKeyboard('EmojiKeyboard', () => EmojiKeyboard);
|