Skip to content

Commit e4f6e08

Browse files
committed
Fix collapse for Manual Config
Signed-off-by: Trung Nguyen <[email protected]>
1 parent 96b597f commit e4f6e08

File tree

1 file changed

+34
-22
lines changed

1 file changed

+34
-22
lines changed

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

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createDockerDesktopClient } from '@docker/extension-api-client';
22
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
3+
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
34
import {
45
Avatar,
56
Button,
@@ -172,9 +173,7 @@ function ClientSetting({
172173
/>
173174
)
174175
}
175-
title={
176-
<Typography variant="subtitle2">{name}</Typography>
177-
}
176+
title={<Typography variant="subtitle2">{name}</Typography>}
178177
subheader={
179178
<Typography
180179
variant="body2"
@@ -187,7 +186,11 @@ function ClientSetting({
187186
onClick={() => setExpanded(!expanded)}
188187
>
189188
Manual configuration
190-
<KeyboardArrowDownIcon fontSize="small" />
189+
{expanded ? (
190+
<KeyboardArrowDownIcon fontSize="small" />
191+
) : (
192+
<KeyboardArrowRightIcon fontSize="small" />
193+
)}
191194
</Typography>
192195
}
193196
action={
@@ -216,15 +219,18 @@ function ClientSetting({
216219
size="small"
217220
>
218221
<Stack direction="row" alignItems="center" spacing={1}>
219-
{buttonsLoading[name]
220-
&&
222+
{(buttonsLoading[name] && (
221223
<>
222-
<Typography sx={{ fontSize: 12, width: 70 }}>Connect</Typography>
224+
<Typography sx={{ fontSize: 12, width: 70 }}>
225+
Connect
226+
</Typography>
223227
<CircularProgress size={12} />
224228
</>
225-
||
226-
<Typography sx={{ fontSize: 12, width: 90 }}>Disconnect</Typography>
227-
}
229+
)) || (
230+
<Typography sx={{ fontSize: 12, width: 90 }}>
231+
Disconnect
232+
</Typography>
233+
)}
228234
</Stack>
229235
</Button>
230236
)}
@@ -253,15 +259,18 @@ function ClientSetting({
253259
size="small"
254260
>
255261
<Stack direction="row" alignItems="center" spacing={1}>
256-
{buttonsLoading[name]
257-
&&
262+
{(buttonsLoading[name] && (
258263
<>
259-
<Typography sx={{ fontSize: 12, width: 70 }}>Disconnect</Typography>
264+
<Typography sx={{ fontSize: 12, width: 70 }}>
265+
Disconnect
266+
</Typography>
260267
<CircularProgress size={12} />
261268
</>
262-
||
263-
<Typography sx={{ fontSize: 12, width: 90 }}>Connect</Typography>
264-
}
269+
)) || (
270+
<Typography sx={{ fontSize: 12, width: 90 }}>
271+
Connect
272+
</Typography>
273+
)}
265274
</Stack>
266275
</Button>
267276
)}
@@ -285,15 +294,18 @@ function ClientSetting({
285294
}}
286295
>
287296
<Stack direction="row" alignItems="center" spacing={1}>
288-
{buttonsLoading[name]
289-
&&
297+
{(buttonsLoading[name] && (
290298
<>
291-
<Typography sx={{ fontSize: 12, width: 70 }}>Disconnect</Typography>
299+
<Typography sx={{ fontSize: 12, width: 70 }}>
300+
Disconnect
301+
</Typography>
292302
<CircularProgress size={12} />
293303
</>
294-
||
295-
<Typography sx={{ fontSize: 12, width: 90 }}>Connect</Typography>
296-
}
304+
)) || (
305+
<Typography sx={{ fontSize: 12, width: 90 }}>
306+
Connect
307+
</Typography>
308+
)}
297309
</Stack>
298310
</Button>
299311
)}

0 commit comments

Comments
 (0)