@@ -42,11 +42,6 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
42
42
const [ search , setSearch ] = useState < string > ( '' ) ;
43
43
const [ tab , setTab ] = useState < number > ( 0 ) ;
44
44
const [ ddVersion , setDdVersion ] = useState < { version : string , build : number } | null > ( null ) ;
45
- const [ openMenus , setOpenMenus ] = useState < { [ key : string ] : { anchorEl : HTMLElement | null , open : boolean } } > ( {
46
- 'demo-customized-menu' : { anchorEl : null , open : false }
47
- } ) ;
48
-
49
- const [ sort , setSort ] = useState < 'name-asc' | 'name-desc' | 'date-asc' | 'date-desc' > ( 'date-desc' ) ;
50
45
const [ showMine , setShowMine ] = useState < boolean > ( localStorage . getItem ( 'showMine' ) === 'true' ) ;
51
46
52
47
const loadDDVersion = async ( ) => {
@@ -134,51 +129,12 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
134
129
< FormGroup >
135
130
< Stack direction = "row" spacing = { 1 } alignItems = 'center' justifyContent = "space-evenly" >
136
131
< TextField label = "Search" sx = { { width : 380 } } value = { search } onChange = { ( e ) => setSearch ( e . target . value ) } />
137
- < IconButton
138
- id = "demo-customized-button"
139
- aria-controls = { openMenus [ 'demo-customized-menu' ] ? 'demo-customized-menu' : undefined }
140
- aria-haspopup = "true"
141
- aria-expanded = { openMenus [ 'demo-customized-menu' ] ? 'true' : undefined }
142
- onClick = { ( e ) => setOpenMenus ( { ...openMenus , 'demo-customized-menu' : { anchorEl : e . currentTarget , open : ! openMenus [ 'demo-customized-menu' ] . open } } ) }
143
- >
144
- < SwapVert />
145
- </ IconButton >
146
132
< FormControlLabel control = { < Switch checked = { showMine } onChange = { ( e ) => {
147
133
setShowMine ( e . target . checked )
148
134
localStorage . setItem ( 'showMine' , e . target . checked . toString ( ) )
149
135
} } /> } label = "Show only enabled tools" />
150
136
</ Stack >
151
137
</ FormGroup >
152
-
153
- < Menu
154
- id = "demo-customized-menu"
155
- MenuListProps = { {
156
- 'aria-labelledby' : 'demo-customized-button' ,
157
- } }
158
- anchorEl = { openMenus [ 'demo-customized-menu' ] . anchorEl || undefined }
159
- open = { openMenus [ 'demo-customized-menu' ] . open }
160
- onClose = { ( ) => setOpenMenus ( { ...openMenus , 'demo-customized-menu' : { anchorEl : null , open : false } } ) }
161
- >
162
- < MenuItem sx = { { fontWeight : sort === 'date-desc' ? 'bold' : 'normal' } } onClick = { ( ) => {
163
- setOpenMenus ( { ...openMenus , 'demo-customized-menu' : { anchorEl : null , open : false } } )
164
- setSort ( 'date-desc' )
165
- } } disableRipple >
166
- ⏰ Most Recent
167
- </ MenuItem >
168
- < Divider sx = { { my : 0.5 } } />
169
- < MenuItem sx = { { fontWeight : sort === 'name-asc' ? 'bold' : 'normal' } } onClick = { ( ) => {
170
- setOpenMenus ( { ...openMenus , 'demo-customized-menu' : { anchorEl : null , open : false } } )
171
- setSort ( 'name-asc' )
172
- } } disableRipple >
173
- Name (A-Z)
174
- </ MenuItem >
175
- < MenuItem sx = { { fontWeight : sort === 'name-desc' ? 'bold' : 'normal' } } onClick = { ( ) => {
176
- setOpenMenus ( { ...openMenus , 'demo-customized-menu' : { anchorEl : null , open : false } } )
177
- setSort ( 'name-desc' )
178
- } } disableRipple >
179
- Name (Z-A)
180
- </ MenuItem >
181
- </ Menu >
182
138
</ Stack >
183
139
}
184
140
0 commit comments