Rocket.Chat.ReactNative/app/containers/MessageComposer/components/CancelEdit.tsx

25 lines
487 B
TypeScript
Raw Normal View History

2024-01-25 14:11:07 +00:00
import React from 'react';
import { BaseButton } from './Buttons';
import { useRoomContext } from '../../../views/RoomView/context';
import { Gap } from './Gap';
export const CancelEdit = () => {
const { action, editCancel } = useRoomContext();
if (action !== 'edit') {
return null;
}
return (
<>
<BaseButton
onPress={() => editCancel?.()}
testID='message-composer-cancel-edit'
accessibilityLabel='Cancel_editing'
icon='close'
/>
<Gap />
</>
);
};