@@ -179,13 +179,28 @@ export const CreateWorkspacePageView: FC<
179
179
spacing = { 1 }
180
180
className = { styles . formSectionFields }
181
181
>
182
- < TextField
183
- disabled
184
- fullWidth
185
- label = { t ( "templateLabel" ) }
186
- value = { props . selectedTemplate ?. name || props . templateName }
187
- variant = "outlined"
188
- />
182
+ { props . selectedTemplate && (
183
+ < Stack
184
+ direction = "row"
185
+ spacing = { 2 }
186
+ className = { styles . template }
187
+ alignItems = "center"
188
+ >
189
+ < div className = { styles . templateIcon } >
190
+ < img src = { props . selectedTemplate . icon } alt = "" />
191
+ </ div >
192
+ < Stack direction = "column" spacing = { 0.5 } >
193
+ < span className = { styles . templateName } >
194
+ { props . selectedTemplate . name }
195
+ </ span >
196
+ { props . selectedTemplate . description && (
197
+ < span className = { styles . templateDescription } >
198
+ { props . selectedTemplate . description }
199
+ </ span >
200
+ ) }
201
+ </ Stack >
202
+ </ Stack >
203
+ ) }
189
204
190
205
< TextField
191
206
{ ...getFieldHelpers ( "name" ) }
@@ -238,22 +253,22 @@ export const CreateWorkspacePageView: FC<
238
253
) }
239
254
240
255
{ /* Template params */ }
241
- < div className = { styles . formSection } >
242
- < div className = { styles . formSectionInfo } >
243
- < h2 className = { styles . formSectionInfoTitle } > Template params</ h2 >
244
- < p className = { styles . formSectionInfoDescription } >
245
- Those values are provided by your template‘s Terraform
246
- configuration.
247
- </ p >
248
- </ div >
256
+ { props . templateSchema && props . templateSchema . length > 0 && (
257
+ < div className = { styles . formSection } >
258
+ < div className = { styles . formSectionInfo } >
259
+ < h2 className = { styles . formSectionInfoTitle } > Template params</ h2 >
260
+ < p className = { styles . formSectionInfoDescription } >
261
+ Those values are provided by your template‘s Terraform
262
+ configuration.
263
+ </ p >
264
+ </ div >
249
265
250
- < Stack
251
- direction = "column"
252
- spacing = { 3 } // Spacing here is diff because the fields here don't have the MUI floating label spacing
253
- className = { styles . formSectionFields }
254
- >
255
- { props . templateSchema &&
256
- props . templateSchema . map ( ( schema ) => (
266
+ < Stack
267
+ direction = "column"
268
+ spacing = { 3 } // Spacing here is diff because the fields here don't have the MUI floating label spacing
269
+ className = { styles . formSectionFields }
270
+ >
271
+ { props . templateSchema . map ( ( schema ) => (
257
272
< ParameterInput
258
273
disabled = { form . isSubmitting }
259
274
key = { schema . id }
@@ -266,8 +281,9 @@ export const CreateWorkspacePageView: FC<
266
281
schema = { schema }
267
282
/>
268
283
) ) }
269
- </ Stack >
270
- </ div >
284
+ </ Stack >
285
+ </ div >
286
+ ) }
271
287
272
288
< FormFooter
273
289
styles = { formFooterStyles }
@@ -312,6 +328,31 @@ const useStyles = makeStyles((theme) => ({
312
328
formSectionFields : {
313
329
width : "100%" ,
314
330
} ,
331
+
332
+ template : {
333
+ padding : theme . spacing ( 2.5 , 3 ) ,
334
+ borderRadius : theme . shape . borderRadius ,
335
+ backgroundColor : theme . palette . background . paper ,
336
+ border : `1px solid ${ theme . palette . divider } ` ,
337
+ } ,
338
+
339
+ templateName : {
340
+ fontSize : 16 ,
341
+ } ,
342
+
343
+ templateDescription : {
344
+ fontSize : 14 ,
345
+ color : theme . palette . text . secondary ,
346
+ } ,
347
+
348
+ templateIcon : {
349
+ width : theme . spacing ( 5 ) ,
350
+ lineHeight : 1 ,
351
+
352
+ "& img" : {
353
+ width : "100%" ,
354
+ } ,
355
+ } ,
315
356
} ) )
316
357
317
358
const useFormFooterStyles = makeStyles ( ( theme ) => ( {
0 commit comments