Remove EmojiPicker footer from Reaction Picker

This commit is contained in:
Danish Ahmed Mirza 2022-06-28 20:48:19 +05:30 committed by Danish
parent f9164cf0f1
commit 036066cd9a
3 changed files with 9 additions and 7 deletions

View File

@ -19,7 +19,7 @@ import { IEmoji, ICustomEmojis, TFrequentlyUsedEmojiModel } from '../../definiti
import { useAppSelector } from '../../lib/hooks'; import { useAppSelector } from '../../lib/hooks';
import { IEmojiPickerProps, EventTypes } from './interfaces'; import { IEmojiPickerProps, EventTypes } from './interfaces';
const EmojiPicker = React.memo(({ onItemClicked, tabEmojiStyle }: IEmojiPickerProps) => { const EmojiPicker = React.memo(({ onItemClicked, tabEmojiStyle, isEmojiKeyboard = false }: IEmojiPickerProps) => {
const [frequentlyUsed, setFrequentlyUsed] = useState<IEmoji[]>([]); const [frequentlyUsed, setFrequentlyUsed] = useState<IEmoji[]>([]);
const [show, setShow] = useState(false); const [show, setShow] = useState(false);
const [width, setWidth] = useState(null); const [width, setWidth] = useState(null);
@ -152,10 +152,12 @@ const EmojiPicker = React.memo(({ onItemClicked, tabEmojiStyle }: IEmojiPickerPr
: renderCategory(tab.category, i, tab.tabLabel, tabsCount) : renderCategory(tab.category, i, tab.tabLabel, tabsCount)
)} )}
</ScrollableTabView> </ScrollableTabView>
{isEmojiKeyboard && (
<Footer <Footer
onSearchPressed={() => onItemClicked(EventTypes.SEARCH_PRESSED)} onSearchPressed={() => onItemClicked(EventTypes.SEARCH_PRESSED)}
onBackspacePressed={() => onItemClicked(EventTypes.BACKSPACE_PRESSED)} onBackspacePressed={() => onItemClicked(EventTypes.BACKSPACE_PRESSED)}
/> />
)}
</View> </View>
); );
}); });

View File

@ -7,9 +7,9 @@ export enum EventTypes {
} }
export interface IEmojiPickerProps { export interface IEmojiPickerProps {
baseUrl: string;
onItemClicked: (event: EventTypes, emoji?: string) => void; onItemClicked: (event: EventTypes, emoji?: string) => void;
tabEmojiStyle?: StyleProp<TextStyle>; tabEmojiStyle?: StyleProp<TextStyle>;
isEmojiKeyboard?: boolean;
} }
export interface IFooterProps { export interface IFooterProps {

View File

@ -22,7 +22,7 @@ const EmojiKeyboard = () => {
style={[styles.emojiKeyboardContainer, { borderTopColor: colors.borderColor }]} style={[styles.emojiKeyboardContainer, { borderTopColor: colors.borderColor }]}
testID='messagebox-keyboard-emoji' testID='messagebox-keyboard-emoji'
> >
<EmojiPicker onItemClicked={onItemClicked} /> <EmojiPicker onItemClicked={onItemClicked} isEmojiKeyboard={true} />
</View> </View>
</Provider> </Provider>
); );