@@ -93,21 +93,20 @@ function selectNode(node) {
93
93
selection . addRange ( range ) ;
94
94
}
95
95
96
+ const iconWidth = 35 ;
97
+
96
98
const StyledIcon = styled ( 'span' ) ( ( { theme } ) => ( {
97
99
display : 'inline-flex' ,
98
100
flexDirection : 'column' ,
99
101
color : theme . palette . text . secondary ,
100
102
margin : '0 4px' ,
101
103
'& > div' : {
102
- display : 'flex' ,
103
- } ,
104
- '& > div > *' : {
105
104
flexGrow : 1 ,
106
105
fontSize : '.6rem' ,
107
106
overflow : 'hidden' ,
108
107
textOverflow : 'ellipsis' ,
109
108
textAlign : 'center' ,
110
- width : 0 ,
109
+ width : `calc( ${ iconWidth } px + ${ theme . spacing ( 2 ) } * 2 + 2px)` ,
111
110
} ,
112
111
} ) ) ;
113
112
@@ -116,6 +115,7 @@ const StyledSvgIcon = styled(SvgIcon)(({ theme }) => ({
116
115
cursor : 'pointer' ,
117
116
color : theme . palette . text . primary ,
118
117
border : '1px solid transparent' ,
118
+ fontSize : iconWidth ,
119
119
borderRadius : '12px' ,
120
120
transition : theme . transitions . create ( [ 'background-color' , 'box-shadow' ] , {
121
121
duration : theme . transitions . duration . shortest ,
@@ -143,7 +143,9 @@ const handleIconClick = (event) => {
143
143
}
144
144
} ;
145
145
146
- const handleLabelClick = ( event ) => selectNode ( event . currentTarget ) ;
146
+ function handleLabelClick ( event ) {
147
+ selectNode ( event . currentTarget ) ;
148
+ }
147
149
148
150
function Icon ( props ) {
149
151
const { icon, onOpenClick } = props ;
@@ -157,15 +159,12 @@ function Icon(props) {
157
159
>
158
160
< StyledSvgIcon
159
161
component = { icon . Component }
160
- fontSize = "large"
161
162
tabIndex = { - 1 }
162
163
onClick = { onOpenClick }
163
164
title = { icon . importName }
164
165
/>
165
- < div >
166
- { /* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- TODO: a11y */ }
167
- < div onClick = { handleLabelClick } > { icon . importName } </ div >
168
- </ div >
166
+ { /* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- TODO: a11y */ }
167
+ < div onClick = { handleLabelClick } > { icon . importName } </ div >
169
168
{ /* eslint-enable jsx-a11y/click-events-have-key-events */ }
170
169
</ StyledIcon >
171
170
) ;
0 commit comments