2019-05-27 16:19:39 +00:00
|
|
|
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
|
2019-05-27 16:19:39 +00:00
|
|
|
}) => {
|
|
|
|
if (editing) {
|
2019-12-04 16:39:53 +00:00
|
|
|
return <CancelEditingButton onPress={editCancel} theme={theme} />;
|
2019-05-27 16:19:39 +00:00
|
|
|
}
|
|
|
|
return (
|
|
|
|
<ToggleEmojiButton
|
|
|
|
show={showEmojiKeyboard}
|
|
|
|
open={openEmoji}
|
|
|
|
close={closeEmoji}
|
2019-12-04 16:39:53 +00:00
|
|
|
theme={theme}
|
2019-05-27 16:19:39 +00:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
LeftButtons.propTypes = {
|
2019-12-04 16:39:53 +00:00
|
|
|
theme: PropTypes.string,
|
2019-05-27 16:19:39 +00:00
|
|
|
showEmojiKeyboard: PropTypes.bool,
|
|
|
|
openEmoji: PropTypes.func.isRequired,
|
|
|
|
closeEmoji: PropTypes.func.isRequired,
|
|
|
|
editing: PropTypes.bool,
|
|
|
|
editCancel: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default LeftButtons;
|