verdnatura-chat/app/containers/MessageBox/RightButtons.ios.js

27 lines
674 B
JavaScript
Raw Permalink Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { SendButton, AudioButton } from './buttons';
const RightButtons = React.memo(({
theme, showSend, submit, recordAudioMessage, recordAudioMessageEnabled
}) => {
if (showSend) {
2019-12-04 16:39:53 +00:00
return <SendButton theme={theme} onPress={submit} />;
}
if (recordAudioMessageEnabled) {
return <AudioButton theme={theme} onPress={recordAudioMessage} />;
}
return null;
});
RightButtons.propTypes = {
2019-12-04 16:39:53 +00:00
theme: PropTypes.string,
showSend: PropTypes.bool,
submit: PropTypes.func.isRequired,
recordAudioMessage: PropTypes.func.isRequired,
recordAudioMessageEnabled: PropTypes.bool
};
export default RightButtons;