Skip to content

Commit 390895e

Browse files
committed
Better in progress button
Signed-off-by: David Gageot <[email protected]>
1 parent 5d10305 commit 390895e

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

src/extension/ui/src/components/tabs/YourClients.tsx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,15 @@ function ClientSetting({
218218
size="small"
219219
>
220220
<Stack direction="row" alignItems="center" spacing={1}>
221-
<Typography sx={{ fontSize: 12, width: buttonsLoading[name] ? 70 : 90 }}>Disconnect</Typography>
222-
{buttonsLoading[name] && <CircularProgress size={12} />}
221+
{buttonsLoading[name]
222+
&&
223+
<>
224+
<Typography sx={{ fontSize: 12, width: 70 }}>Connect</Typography>
225+
<CircularProgress size={12} />
226+
</>
227+
||
228+
<Typography sx={{ fontSize: 12, width: 90 }}>Disconnect</Typography>
229+
}
223230
</Stack>
224231
</Button>
225232
)}
@@ -248,8 +255,15 @@ function ClientSetting({
248255
size="small"
249256
>
250257
<Stack direction="row" alignItems="center" spacing={1}>
251-
<Typography sx={{ fontSize: 12, width: buttonsLoading[name] ? 70 : 90 }}>Connect</Typography>
252-
{buttonsLoading[name] && <CircularProgress size={12} />}
258+
{buttonsLoading[name]
259+
&&
260+
<>
261+
<Typography sx={{ fontSize: 12, width: 70 }}>Disconnect</Typography>
262+
<CircularProgress size={12} />
263+
</>
264+
||
265+
<Typography sx={{ fontSize: 12, width: 90 }}>Connect</Typography>
266+
}
253267
</Stack>
254268
</Button>
255269
)}
@@ -273,8 +287,15 @@ function ClientSetting({
273287
}}
274288
>
275289
<Stack direction="row" alignItems="center" spacing={1}>
276-
<Typography sx={{ fontSize: 12, width: buttonsLoading[name] ? 70 : 90 }}>Connect</Typography>
277-
{buttonsLoading[name] && <CircularProgress size={12} />}
290+
{buttonsLoading[name]
291+
&&
292+
<>
293+
<Typography sx={{ fontSize: 12, width: 70 }}>Disconnect</Typography>
294+
<CircularProgress size={12} />
295+
</>
296+
||
297+
<Typography sx={{ fontSize: 12, width: 90 }}>Connect</Typography>
298+
}
278299
</Stack>
279300
</Button>
280301
)}

0 commit comments

Comments
 (0)