2019-05-27 16:19:39 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import BaseButton from './BaseButton';
|
|
|
|
|
2019-12-11 23:01:12 +00:00
|
|
|
const ToggleEmojiButton = React.memo(({
|
|
|
|
theme, show, open, close
|
|
|
|
}) => {
|
2019-05-27 16:19:39 +00:00
|
|
|
if (show) {
|
|
|
|
return (
|
|
|
|
<BaseButton
|
|
|
|
onPress={close}
|
|
|
|
testID='messagebox-close-emoji'
|
|
|
|
accessibilityLabel='Close_emoji_selector'
|
|
|
|
icon='keyboard'
|
2019-12-11 23:01:12 +00:00
|
|
|
theme={theme}
|
2019-05-27 16:19:39 +00:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
<BaseButton
|
|
|
|
onPress={open}
|
|
|
|
testID='messagebox-open-emoji'
|
|
|
|
accessibilityLabel='Open_emoji_selector'
|
|
|
|
icon='emoji'
|
2019-12-11 23:01:12 +00:00
|
|
|
theme={theme}
|
2019-05-27 16:19:39 +00:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
ToggleEmojiButton.propTypes = {
|
2019-12-11 23:01:12 +00:00
|
|
|
theme: PropTypes.string,
|
2019-05-27 16:19:39 +00:00
|
|
|
show: PropTypes.bool,
|
|
|
|
open: PropTypes.func.isRequired,
|
|
|
|
close: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ToggleEmojiButton;
|