vn-verdnaturachat/app/containers/MessageBox/LeftButtons.android.js

32 lines
729 B
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { CancelEditingButton, ToggleEmojiButton } from './buttons';
const LeftButtons = React.memo(({
2019-12-04 16:39:53 +00:00
theme, showEmojiKeyboard, editing, editCancel, openEmoji, closeEmoji
}) => {
if (editing) {
2019-12-04 16:39:53 +00:00
return <CancelEditingButton onPress={editCancel} theme={theme} />;
}
return (
<ToggleEmojiButton
show={showEmojiKeyboard}
open={openEmoji}
close={closeEmoji}
2019-12-04 16:39:53 +00:00
theme={theme}
/>
);
});
LeftButtons.propTypes = {
2019-12-04 16:39:53 +00:00
theme: PropTypes.string,
showEmojiKeyboard: PropTypes.bool,
openEmoji: PropTypes.func.isRequired,
closeEmoji: PropTypes.func.isRequired,
editing: PropTypes.bool,
editCancel: PropTypes.func.isRequired
};
export default LeftButtons;