Skip to content

Commit

Permalink
Fix:Formattin toolbar tooltip names according to rocket.chat (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushKumar123456789 authored Jan 27, 2025
1 parent 577a1f0 commit db8eb49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 9 additions & 5 deletions packages/react/src/lib/textFormat.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
export const formatter = [
{ name: 'bold', pattern: '*{{text}}*' },
{ name: 'italic', pattern: '_{{text}}_' },
{ name: 'strike', pattern: '~{{text}}~' },
{ name: 'code', pattern: '`{{text}}`' },
{ name: 'multiline', pattern: '```\n{{text}}\n``` ' },
{ name: 'bold', pattern: '*{{text}}*', tooltip: 'Bold' },
{ name: 'italic', pattern: '_{{text}}_', tooltip: 'Italic' },
{ name: 'strike', pattern: '~{{text}}~', tooltip: 'Strikethrough' },
{ name: 'code', pattern: '`{{text}}`', tooltip: 'Inline code' },
{
name: 'multiline',
pattern: '```\n{{text}}\n```',
tooltip: 'Multi-line code',
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ const ChatInputFormattingToolbar = ({
formatter: formatters
.map((name) => formatter.find((item) => item.name === name))
.map((item) => (
<Tooltip text={item.name} position="top" key={`formatter-${item.name}`}>
<Tooltip
text={item.tooltip || item.name}
position="top"
key={`formatter-${item.name}`}
>
<ActionButton
square
disabled={isRecordingMessage}
Expand Down

0 comments on commit db8eb49

Please sign in to comment.