Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Tooltips names for Formatting toolbar is not correct and not align with rocket.chat #879

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading