feat: Add support to cancel editing message action (#31347)
Co-authored-by: Hugo Costa <20212776+hugocostadev@users.noreply.github.com> Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>pull/31467/head
parent
cced9b54bd
commit
e1fa2b84fb
@ -0,0 +1,6 @@ |
||||
--- |
||||
"@rocket.chat/meteor": minor |
||||
"@rocket.chat/ui-composer": minor |
||||
--- |
||||
|
||||
New feature to support cancel message editing message and hints for shortcuts. |
||||
@ -0,0 +1,6 @@ |
||||
import { Button } from '@rocket.chat/fuselage'; |
||||
import type { ComponentProps, ReactElement } from 'react'; |
||||
|
||||
const MessageComposerButton = (props: ComponentProps<typeof Button>): ReactElement => <Button small {...props} />; |
||||
|
||||
export default MessageComposerButton; |
||||
@ -0,0 +1,21 @@ |
||||
import type { IconProps } from '@rocket.chat/fuselage'; |
||||
import { Box, Icon, Tag } from '@rocket.chat/fuselage'; |
||||
import type { ReactElement, ReactNode } from 'react'; |
||||
|
||||
type MessageComposerHintProps = { |
||||
children: string; |
||||
icon?: IconProps['name']; |
||||
helperText?: ReactNode; |
||||
}; |
||||
|
||||
const MessageComposerHint = ({ icon, children, helperText }: MessageComposerHintProps): ReactElement => ( |
||||
<Box pbs={0} pbe={4} display='flex' flexDirection='row' justifyContent='space-between' alignItems='center'> |
||||
<Tag icon={icon ? <Icon mie={4} name={icon} size='x12' /> : undefined}>{children}</Tag> |
||||
{helperText && ( |
||||
<Box fontScale='c1' color='font-hint'> |
||||
{helperText} |
||||
</Box> |
||||
)} |
||||
</Box> |
||||
); |
||||
export default MessageComposerHint; |
||||
Loading…
Reference in new issue