Просмотр исходного кода

fix(chat): added emoji tooltip and enter key in smiley panel

factor2
ilaydadastan 1 год назад
Родитель
Сommit
38be09fc54
1 измененных файлов: 7 добавлений и 4 удалений
  1. 7
    4
      react/features/chat/components/web/SmileysPanel.tsx

+ 7
- 4
react/features/chat/components/web/SmileysPanel.tsx Просмотреть файл

@@ -1,6 +1,7 @@
1 1
 import React, { PureComponent } from 'react';
2 2
 import Emoji from 'react-emoji-render';
3 3
 
4
+import Tooltip from '../../../base/tooltip/components/Tooltip';
4 5
 import { smileys } from '../../smileys';
5 6
 
6 7
 /**
@@ -60,7 +61,7 @@ class SmileysPanel extends PureComponent<IProps> {
60 61
      * @returns {void}
61 62
      */
62 63
     _onKeyPress(e: React.KeyboardEvent<HTMLDivElement>) {
63
-        if (e.key === ' ') {
64
+        if (e.key === ' ' || e.key === 'Enter') {
64 65
             e.preventDefault(); // @ts-ignore
65 66
             this.props.onSmileySelect(e.target.id && smileys[e.target.id]);
66 67
         }
@@ -95,9 +96,11 @@ class SmileysPanel extends PureComponent<IProps> {
95 96
                 onKeyPress = { this._onKeyPress }
96 97
                 role = 'option'
97 98
                 tabIndex = { 0 }>
98
-                <Emoji
99
-                    onlyEmojiClassName = 'smiley'
100
-                    text = { smileys[smileyKey as keyof typeof smileys] } />
99
+                <Tooltip content = { smileys[smileyKey as keyof typeof smileys] }>
100
+                    <Emoji
101
+                        onlyEmojiClassName = 'smiley'
102
+                        text = { smileys[smileyKey as keyof typeof smileys] } />
103
+                </Tooltip>
101 104
             </div>
102 105
         ));
103 106
 

Загрузка…
Отмена
Сохранить