vn-verdnaturachat/app/containers/MessageBox/buttons/ToggleEmojiButton.js

39 lines
725 B
JavaScript
Raw Normal View History

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