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(({
|
2019-12-11 23:01:12 +00:00
|
|
|
theme, showSend, submit, recordAudioMessage, showFileActions
|
2019-05-27 16:19:39 +00:00
|
|
|
}) => {
|
|
|
|
if (showSend) {
|
2019-12-11 23:01:12 +00:00
|
|
|
return <SendButton onPress={submit} theme={theme} />;
|
2019-05-27 16:19:39 +00:00
|
|
|
}
|
|
|
|
return (
|
2019-10-07 20:56:30 +00:00
|
|
|
<>
|
2019-12-11 23:01:12 +00:00
|
|
|
<AudioButton onPress={recordAudioMessage} theme={theme} />
|
|
|
|
<FileButton onPress={showFileActions} theme={theme} />
|
2019-10-07 20:56:30 +00:00
|
|
|
</>
|
2019-05-27 16:19:39 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
RightButtons.propTypes = {
|
2019-12-11 23:01:12 +00:00
|
|
|
theme: PropTypes.string,
|
2019-05-27 16:19:39 +00:00
|
|
|
showSend: PropTypes.bool,
|
|
|
|
submit: PropTypes.func.isRequired,
|
|
|
|
recordAudioMessage: PropTypes.func.isRequired,
|
|
|
|
showFileActions: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default RightButtons;
|