1
1
import { Fragment , useEffect , useState } from 'react' ;
2
2
3
3
import { ChevronDown } from '@gravity-ui/icons' ;
4
- import {
5
- ActionTooltip ,
6
- Button ,
7
- HelpMark ,
8
- Hotkey ,
9
- Icon ,
10
- Menu ,
11
- Popover ,
12
- Popup ,
13
- } from '@gravity-ui/uikit' ;
4
+ import { ActionTooltip , Button , HelpMark , Hotkey , Icon , Menu , Popover } from '@gravity-ui/uikit' ;
14
5
15
6
import { SelectPopup } from '../bundle/SelectPopup' ;
16
7
import { cn } from '../classname' ;
@@ -110,7 +101,12 @@ export function ToolbarListButton<E>({
110
101
</ Button >
111
102
</ ActionTooltip >
112
103
</ Popover >
113
- < SelectPopup mobile = { mobile } open = { popupOpen } onClose = { hide } buttonRef = { anchorElement } >
104
+ < SelectPopup
105
+ mobile = { mobile }
106
+ open = { popupOpen }
107
+ onClose = { hide }
108
+ anchorElement = { anchorElement }
109
+ >
114
110
< Menu size = "l" className = { b ( 'menu' ) } >
115
111
{ data
116
112
. map ( ( data ) => {
@@ -132,9 +128,7 @@ export function ToolbarListButton<E>({
132
128
133
129
const disabled = ! isEnable ( editor ) ;
134
130
135
- const hideHintWhenDisabled =
136
- mobile || hintWhenDisabled === false || ! disabled ;
137
-
131
+ const hideHintWhenDisabled = hintWhenDisabled === false || ! disabled ;
138
132
const hintWhenDisabledText =
139
133
typeof hintWhenDisabled === 'string'
140
134
? hintWhenDisabled
@@ -169,7 +163,7 @@ export function ToolbarListButton<E>({
169
163
key = { id }
170
164
>
171
165
{ ( props , ref ) => (
172
- < PreviewTooltip preview = { preview } >
166
+ < PreviewTooltip preview = { preview } mobile >
173
167
< Menu . Item
174
168
key = { id }
175
169
ref = { ref }
@@ -186,17 +180,19 @@ export function ToolbarListButton<E>({
186
180
>
187
181
< div className = { b ( 'item' ) } >
188
182
{ titleText }
189
- < div className = { b ( 'extra' ) } >
190
- { hotkey && < Hotkey value = { hotkey } /> }
191
- { hintText && (
192
- < HelpMark
193
- className = { b ( 'hint' ) }
194
- popoverProps = { { modal : false } }
195
- >
196
- { hintText }
197
- </ HelpMark >
198
- ) }
199
- </ div >
183
+ { ! mobile && (
184
+ < div className = { b ( 'extra' ) } >
185
+ { hotkey && < Hotkey value = { hotkey } /> }
186
+ { hintText && (
187
+ < HelpMark
188
+ className = { b ( 'hint' ) }
189
+ popoverProps = { { modal : false } }
190
+ >
191
+ { hintText }
192
+ </ HelpMark >
193
+ ) }
194
+ </ div >
195
+ ) }
200
196
</ div >
201
197
</ Menu . Item >
202
198
</ PreviewTooltip >
0 commit comments