2019-05-27 16:19:39 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import { SendButton, AudioButton, FileButton } from './buttons';
|
|
|
|
|
|
|
|
const RightButtons = React.memo(({
|
|
|
|
showSend, submit, recordAudioMessage, showFileActions
|
|
|
|
}) => {
|
|
|
|
if (showSend) {
|
|
|
|
return <SendButton onPress={submit} />;
|
|
|
|
}
|
|
|
|
return (
|
2019-09-24 20:26:56 +00:00
|
|
|
<>
|
2019-05-27 16:19:39 +00:00
|
|
|
<AudioButton onPress={recordAudioMessage} />
|
|
|
|
<FileButton onPress={showFileActions} />
|
2019-09-24 20:26:56 +00:00
|
|
|
</>
|
2019-05-27 16:19:39 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
RightButtons.propTypes = {
|
|
|
|
showSend: PropTypes.bool,
|
|
|
|
submit: PropTypes.func.isRequired,
|
|
|
|
recordAudioMessage: PropTypes.func.isRequired,
|
|
|
|
showFileActions: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default RightButtons;
|