File tree 1 file changed +19
-17
lines changed
site/src/modules/resources
1 file changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -205,21 +205,15 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
205
205
const canSharePortsPublic =
206
206
canSharePorts && template . max_port_share_level === "public" ;
207
207
208
- const publicMenuItem = (
209
- < >
210
- { canSharePortsPublic ? (
211
- < MenuItem value = "public" > Public</ MenuItem >
212
- ) : (
213
- < Tooltip title = "This workspace template does not allow sharing ports with unauthenticated users." >
214
- { /* Tooltips don't work directly on disabled MenuItem components so you must wrap in div. */ }
215
- < div >
216
- < MenuItem value = "public" disabled >
217
- Public
218
- </ MenuItem >
219
- </ div >
220
- </ Tooltip >
221
- ) }
222
- </ >
208
+ const disabledPublicMenuItem = (
209
+ < Tooltip title = "This workspace template does not allow sharing ports with unauthenticated users." >
210
+ { /* Tooltips don't work directly on disabled MenuItem components so you must wrap in div. */ }
211
+ < div >
212
+ < MenuItem value = "public" disabled >
213
+ Public
214
+ </ MenuItem >
215
+ </ div >
216
+ </ Tooltip >
223
217
) ;
224
218
225
219
return (
@@ -447,7 +441,11 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
447
441
< MenuItem value = "authenticated" >
448
442
Authenticated
449
443
</ MenuItem >
450
- { publicMenuItem }
444
+ { canSharePortsPublic ? (
445
+ < MenuItem value = "public" > Public</ MenuItem >
446
+ ) : (
447
+ disabledPublicMenuItem
448
+ ) }
451
449
</ Select >
452
450
</ FormControl >
453
451
< Button
@@ -512,7 +510,11 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
512
510
label = "Sharing Level"
513
511
>
514
512
< MenuItem value = "authenticated" > Authenticated</ MenuItem >
515
- { publicMenuItem }
513
+ { canSharePortsPublic ? (
514
+ < MenuItem value = "public" > Public</ MenuItem >
515
+ ) : (
516
+ disabledPublicMenuItem
517
+ ) }
516
518
</ TextField >
517
519
< LoadingButton
518
520
variant = "contained"
You can’t perform that action at this time.
0 commit comments