@@ -42,11 +42,6 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
4242 const [ search , setSearch ] = useState < string > ( '' ) ;
4343 const [ tab , setTab ] = useState < number > ( 0 ) ;
4444 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' ) ;
5045 const [ showMine , setShowMine ] = useState < boolean > ( localStorage . getItem ( 'showMine' ) === 'true' ) ;
5146
5247 const loadDDVersion = async ( ) => {
@@ -134,51 +129,12 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
134129 < FormGroup >
135130 < Stack direction = "row" spacing = { 1 } alignItems = 'center' justifyContent = "space-evenly" >
136131 < 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 >
146132 < FormControlLabel control = { < Switch checked = { showMine } onChange = { ( e ) => {
147133 setShowMine ( e . target . checked )
148134 localStorage . setItem ( 'showMine' , e . target . checked . toString ( ) )
149135 } } /> } label = "Show only enabled tools" />
150136 </ Stack >
151137 </ 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 >
182138 </ Stack >
183139 }
184140
0 commit comments