Rocket.Chat.ReactNative/app/containers/MessageBox/LeftButtons.ios.js

22 lines
503 B
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { CancelEditingButton, FileButton } from './buttons';
const LeftButtons = React.memo(({
showFileActions, editing, editCancel
}) => {
if (editing) {
return <CancelEditingButton onPress={editCancel} />;
}
return <FileButton onPress={showFileActions} />;
});
LeftButtons.propTypes = {
showFileActions: PropTypes.func.isRequired,
editing: PropTypes.bool,
editCancel: PropTypes.func.isRequired
};
export default LeftButtons;