@@ -337,19 +337,29 @@ const NewProject = () => {
337337} ;
338338
339339const Template = ( ) => {
340- const { client, template, setTemplate, templates, fetchProjects, compileLoading, deployLoading, activateLoading } =
341- useStore (
342- useShallow ( ( state ) => ( {
343- client : state . global . client ,
344- template : state . project . template . data ,
345- setTemplate : state . project . setTemplate ,
346- templates : state . project . templates . data ,
347- fetchProjects : state . project . fetchProjects ,
348- compileLoading : state . compile . loading ,
349- deployLoading : state . deploy . loading ,
350- activateLoading : state . activate . loading ,
351- } ) )
352- ) ;
340+ const {
341+ client,
342+ template,
343+ setTemplate,
344+ templates,
345+ openzeppelinTemplates,
346+ fetchProjects,
347+ compileLoading,
348+ deployLoading,
349+ activateLoading,
350+ } = useStore (
351+ useShallow ( ( state ) => ( {
352+ client : state . global . client ,
353+ template : state . project . template . data ,
354+ setTemplate : state . project . setTemplate ,
355+ templates : state . project . templates . data ,
356+ openzeppelinTemplates : state . project . openzeppelinTemplates . data ,
357+ fetchProjects : state . project . fetchProjects ,
358+ compileLoading : state . compile . loading ,
359+ deployLoading : state . deploy . loading ,
360+ activateLoading : state . activate . loading ,
361+ } ) )
362+ ) ;
353363 const isLoading = compileLoading || deployLoading || activateLoading ;
354364
355365 const createTemplate = async ( ) => {
@@ -419,14 +429,26 @@ const Template = () => {
419429 < Form . Label > Select a Template</ Form . Label >
420430 < InputGroup >
421431 < Form . Control className = "custom-select" as = "select" value = { template ?? "" } onChange = { handleTemplateOnChange } >
422- { templates &&
423- templates . map ( ( temp , idx ) => {
424- return (
425- < option value = { temp } key = { idx } >
426- { temp }
427- </ option >
428- ) ;
429- } ) }
432+ < optgroup label = "OpenZeppelin Templates" >
433+ { openzeppelinTemplates &&
434+ openzeppelinTemplates . map ( ( temp : string , idx : number ) => {
435+ return (
436+ < option value = { temp } key = { `oz-${ idx } ` } >
437+ { temp }
438+ </ option >
439+ ) ;
440+ } ) }
441+ </ optgroup >
442+ < optgroup label = "Basic Templates" >
443+ { templates &&
444+ templates . map ( ( temp , idx ) => {
445+ return (
446+ < option value = { temp } key = { idx } >
447+ { temp }
448+ </ option >
449+ ) ;
450+ } ) }
451+ </ optgroup >
430452 </ Form . Control >
431453 < Button
432454 className = "relative border-0"
0 commit comments