-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
cced9b5
commit e1fa2b8
Showing
6 changed files
with
92 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/ui-composer/src/MessageComposer/MessageComposerButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
21 changes: 21 additions & 0 deletions
21
packages/ui-composer/src/MessageComposer/MessageComposerHint.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters