1
- import React , { useEffect , useState , Suspense } from 'react' ;
1
+ import React , { useState , Suspense } from 'react' ;
2
2
import { createDockerDesktopClient } from '@docker/extension-api-client' ;
3
- import { Stack , Typography , Button , IconButton , Alert , DialogTitle , Dialog , DialogContent , CircularProgress , Paper , Box , SvgIcon , useTheme } from '@mui/material' ;
4
- import { CatalogItemWithName } from './components/tile/Tile ' ;
3
+ import { Typography , Button , IconButton , Alert , DialogTitle , Dialog , DialogContent , CircularProgress , Paper , Box , SvgIcon , useTheme } from '@mui/material' ;
4
+ import { CatalogItemWithName } from './types/catalog ' ;
5
5
import { Close } from '@mui/icons-material' ;
6
6
import { CatalogGrid } from './components/CatalogGrid' ;
7
7
import { POLL_INTERVAL } from './Constants' ;
8
8
import { CatalogProvider , useCatalogContext } from './context/CatalogContext' ;
9
9
import { ConfigProvider } from './context/ConfigContext' ;
10
10
import { MCPClientProvider , useMCPClientContext } from './context/MCPClientContext' ;
11
11
import ConfigurationModal from './components/ConfigurationModal' ;
12
- import { Settings as SettingsIcon } from '@mui/icons-material' ;
13
12
14
13
const Settings = React . lazy ( ( ) => import ( './components/Settings' ) ) ;
15
14
16
- // Create lazy-loaded logo components
17
- const LazyDarkLogo = React . lazy ( ( ) => import ( './components/DarkLogo' ) ) ;
18
- const LazyLightLogo = React . lazy ( ( ) => import ( './components/LightLogo' ) ) ;
19
-
20
- // Logo component that uses Suspense for conditional loading
21
- const Logo = ( ) => {
22
- const theme = useTheme ( ) ;
23
- const isDarkMode = theme . palette . mode === 'dark' ;
24
-
25
- return (
26
- < Suspense fallback = { < Box sx = { { height : '5em' , display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } > < CircularProgress size = { 24 } /> </ Box > } >
27
- < Box sx = { { display : 'flex' , alignItems : 'center' , width : '100%' } } >
28
- { isDarkMode ? < LazyDarkLogo /> : < LazyLightLogo /> }
29
- </ Box >
30
- </ Suspense >
31
- ) ;
32
- }
33
-
34
15
export const client = createDockerDesktopClient ( ) ;
35
16
36
17
const DEFAULT_SETTINGS = {
@@ -112,7 +93,7 @@ function AppContent({ settings, setSettings, configuringItem, setConfiguringItem
112
93
</ Paper >
113
94
) ;
114
95
}
115
-
96
+ const isDataFetching = imagesIsFetching || secretsLoading || catalogLoading || registryLoading || mcpFetching ;
116
97
return (
117
98
< >
118
99
{ settings . showModal && (
@@ -147,39 +128,10 @@ function AppContent({ settings, setSettings, configuringItem, setConfiguringItem
147
128
/>
148
129
) }
149
130
150
- { /* Show a small loading indicator in the corner during background refetching */ }
151
- { ( imagesIsFetching || secretsLoading || catalogLoading || registryLoading || mcpFetching ) && (
152
- < Box
153
- sx = { {
154
- position : 'fixed' ,
155
- bottom : 16 ,
156
- right : 16 ,
157
- zIndex : 9999 ,
158
- display : 'flex' ,
159
- alignItems : 'center' ,
160
- backgroundColor : 'background.paper' ,
161
- borderRadius : 2 ,
162
- padding : 1 ,
163
- boxShadow : 3
164
- } }
165
- >
166
- < CircularProgress size = { 20 } sx = { { mr : 1 } } />
167
- < Typography variant = "caption" > Refreshing data...</ Typography >
168
- </ Box >
169
- ) }
170
-
171
- < Stack direction = "column" spacing = { 1 } justifyContent = 'center' alignItems = 'center' >
172
- < Stack direction = "row" spacing = { 1 } justifyContent = 'space-evenly' alignItems = 'center' sx = { { width : '100%' , maxWidth : '1000px' } } >
173
- < Logo />
174
- < IconButton sx = { { ml : 2 , alignSelf : 'flex-end' , justifyContent : 'flex-end' } } onClick = { ( ) => setSettings ( { ...settings , showModal : true } ) } >
175
- < SettingsIcon sx = { { fontSize : '1.5em' } } />
176
- </ IconButton >
177
- </ Stack >
178
- < CatalogGrid
179
- setConfiguringItem = { setConfiguringItem }
180
- showSettings = { ( ) => setSettings ( { ...settings , showModal : true } ) }
181
- />
182
- </ Stack >
131
+ < CatalogGrid
132
+ setConfiguringItem = { setConfiguringItem }
133
+ showSettings = { ( ) => setSettings ( { ...settings , showModal : true } ) }
134
+ />
183
135
</ >
184
136
) ;
185
137
}
0 commit comments