@@ -51,7 +51,7 @@ export const TemplatePageView: FC<React.PropsWithChildren<TemplatePageViewProps>
51
51
templateVersions,
52
52
handleDeleteTemplate,
53
53
deleteTemplateError,
54
- canDeleteTemplate
54
+ canDeleteTemplate,
55
55
} ) => {
56
56
const styles = useStyles ( )
57
57
const readme = frontMatter ( activeTemplateVersion . readme )
@@ -61,102 +61,103 @@ export const TemplatePageView: FC<React.PropsWithChildren<TemplatePageViewProps>
61
61
return resources . filter ( ( resource ) => resource . workspace_transition === "start" )
62
62
}
63
63
64
- const createWorkspaceButton = ( className : string ) => < Link
65
- underline = "none"
66
- component = { RouterLink }
67
- to = { `/templates/${ template . name } /workspace` }
68
- >
69
- < Button className = { className } startIcon = { < AddCircleOutline /> } > { Language . createButton } </ Button >
70
- </ Link >
71
-
64
+ const createWorkspaceButton = ( className : string ) => (
65
+ < Link underline = "none" component = { RouterLink } to = { `/templates/${ template . name } /workspace` } >
66
+ < Button className = { className } startIcon = { < AddCircleOutline /> } >
67
+ { Language . createButton }
68
+ </ Button >
69
+ </ Link >
70
+ )
72
71
73
72
return (
74
73
< Margins >
75
74
< >
76
- { deleteTemplateError && < ErrorSummary error = { deleteTemplateError } dismissible /> }
77
- < PageHeader
78
- actions = {
79
- < Stack direction = "row" spacing = { 1 } >
80
- < Link
81
- underline = "none"
82
- component = { RouterLink }
83
- to = { `/templates/${ template . name } /settings` }
84
- >
85
- < Button variant = "outlined" startIcon = { < SettingsOutlined /> } >
86
- { Language . settingsButton }
87
- </ Button >
88
- </ Link >
75
+ { deleteTemplateError && < ErrorSummary error = { deleteTemplateError } dismissible /> }
76
+ < PageHeader
77
+ actions = {
78
+ < Stack direction = "row" spacing = { 1 } >
79
+ < Link
80
+ underline = "none"
81
+ component = { RouterLink }
82
+ to = { `/templates/${ template . name } /settings` }
83
+ >
84
+ < Button variant = "outlined" startIcon = { < SettingsOutlined /> } >
85
+ { Language . settingsButton }
86
+ </ Button >
87
+ </ Link >
89
88
90
- { canDeleteTemplate ?
91
- < DropdownButton
92
- primaryAction = { createWorkspaceButton ( styles . actionButton ) }
93
- secondaryActions = { [
94
- {
95
- action : "delete" ,
96
- button : < DeleteButton handleAction = { ( ) => handleDeleteTemplate ( template . id ) } /> ,
97
- } ,
98
- ] }
99
- canCancel = { false }
100
- />
101
- :
102
- createWorkspaceButton ( "" )
103
- }
89
+ { canDeleteTemplate ? (
90
+ < DropdownButton
91
+ primaryAction = { createWorkspaceButton ( styles . actionButton ) }
92
+ secondaryActions = { [
93
+ {
94
+ action : "delete" ,
95
+ button : (
96
+ < DeleteButton handleAction = { ( ) => handleDeleteTemplate ( template . id ) } />
97
+ ) ,
98
+ } ,
99
+ ] }
100
+ canCancel = { false }
101
+ />
102
+ ) : (
103
+ createWorkspaceButton ( "" )
104
+ ) }
105
+ </ Stack >
106
+ }
107
+ >
108
+ < Stack direction = "row" spacing = { 3 } className = { styles . pageTitle } >
109
+ < div >
110
+ { hasIcon ? (
111
+ < div className = { styles . iconWrapper } >
112
+ < img src = { template . icon } alt = "" />
113
+ </ div >
114
+ ) : (
115
+ < Avatar className = { styles . avatar } > { firstLetter ( template . name ) } </ Avatar >
116
+ ) }
117
+ </ div >
118
+ < div >
119
+ < PageHeaderTitle > { template . name } </ PageHeaderTitle >
120
+ < PageHeaderSubtitle >
121
+ { template . description === "" ? Language . noDescription : template . description }
122
+ </ PageHeaderSubtitle >
123
+ </ div >
104
124
</ Stack >
105
- }
106
- >
107
- < Stack direction = "row" spacing = { 3 } className = { styles . pageTitle } >
108
- < div >
109
- { hasIcon ? (
110
- < div className = { styles . iconWrapper } >
111
- < img src = { template . icon } alt = "" />
112
- </ div >
113
- ) : (
114
- < Avatar className = { styles . avatar } > { firstLetter ( template . name ) } </ Avatar >
115
- ) }
116
- </ div >
117
- < div >
118
- < PageHeaderTitle > { template . name } </ PageHeaderTitle >
119
- < PageHeaderSubtitle >
120
- { template . description === "" ? Language . noDescription : template . description }
121
- </ PageHeaderSubtitle >
122
- </ div >
123
- </ Stack >
124
- </ PageHeader >
125
+ </ PageHeader >
125
126
126
- < Stack spacing = { 2.5 } >
127
- < TemplateStats template = { template } activeVersion = { activeTemplateVersion } />
128
- < WorkspaceSection
129
- title = { Language . resourcesTitle }
130
- contentsProps = { { className : styles . resourcesTableContents } }
131
- >
132
- < TemplateResourcesTable resources = { getStartedResources ( templateResources ) } />
133
- </ WorkspaceSection >
134
- < WorkspaceSection
135
- title = { Language . readmeTitle }
136
- contentsProps = { { className : styles . readmeContents } }
137
- >
138
- < div className = { styles . markdownWrapper } >
139
- < ReactMarkdown
140
- components = { {
141
- a : ( { href, target, children } ) => (
142
- < Link href = { href } target = { target } >
143
- { children }
144
- </ Link >
145
- ) ,
146
- } }
147
- >
148
- { readme . body }
149
- </ ReactMarkdown >
150
- </ div >
151
- </ WorkspaceSection >
152
- < WorkspaceSection
153
- title = { Language . versionsTitle }
154
- contentsProps = { { className : styles . versionsTableContents } }
155
- >
156
- < VersionsTable versions = { templateVersions } />
157
- </ WorkspaceSection >
158
- </ Stack >
159
- </ >
127
+ < Stack spacing = { 2.5 } >
128
+ < TemplateStats template = { template } activeVersion = { activeTemplateVersion } />
129
+ < WorkspaceSection
130
+ title = { Language . resourcesTitle }
131
+ contentsProps = { { className : styles . resourcesTableContents } }
132
+ >
133
+ < TemplateResourcesTable resources = { getStartedResources ( templateResources ) } />
134
+ </ WorkspaceSection >
135
+ < WorkspaceSection
136
+ title = { Language . readmeTitle }
137
+ contentsProps = { { className : styles . readmeContents } }
138
+ >
139
+ < div className = { styles . markdownWrapper } >
140
+ < ReactMarkdown
141
+ components = { {
142
+ a : ( { href, target, children } ) => (
143
+ < Link href = { href } target = { target } >
144
+ { children }
145
+ </ Link >
146
+ ) ,
147
+ } }
148
+ >
149
+ { readme . body }
150
+ </ ReactMarkdown >
151
+ </ div >
152
+ </ WorkspaceSection >
153
+ < WorkspaceSection
154
+ title = { Language . versionsTitle }
155
+ contentsProps = { { className : styles . versionsTableContents } }
156
+ >
157
+ < VersionsTable versions = { templateVersions } />
158
+ </ WorkspaceSection >
159
+ </ Stack >
160
+ </ >
160
161
</ Margins >
161
162
)
162
163
}
0 commit comments