@@ -24,12 +24,7 @@ import PaletteIcon from '@mui/icons-material/PaletteOutlined';
24
24
import codeSandbox from 'docs/src/modules/sandbox/CodeSandbox' ;
25
25
import stackBlitz from 'docs/src/modules/sandbox/StackBlitz' ;
26
26
import sourceMaterialTemplates from 'docs/src/modules/material/sourceMaterialTemplates' ;
27
-
28
- function pascalCase ( str ) {
29
- return str
30
- . replace ( / [ ^ \w ] + ( .) / g, ( _ , chr ) => chr . toUpperCase ( ) )
31
- . replace ( / ^ ( .) / , ( _ , chr ) => chr . toUpperCase ( ) ) ;
32
- }
27
+ import { pascalCase } from 'docs/src/modules/utils/helpers' ;
33
28
34
29
const StyledAppBar = styled ( AppBar ) ( ( { theme } ) => ( {
35
30
position : 'relative' ,
@@ -196,7 +191,7 @@ const brandingTheme = createTheme({
196
191
...getThemedComponents ( ) ,
197
192
} ) ;
198
193
199
- function TemplateFrame ( { children } ) {
194
+ export default function TemplateFrame ( { children } ) {
200
195
const router = useRouter ( ) ;
201
196
const templateId = router . pathname . split ( '/' ) . pop ( ) ;
202
197
const templateName = pascalCase ( templateId ) ;
@@ -262,17 +257,17 @@ function TemplateFrame({ children }) {
262
257
'& > *' : { flexShrink : 0 } ,
263
258
} }
264
259
>
265
- < Tooltip title = "Open Template via CodeSandbox " >
260
+ < Tooltip title = "Edit in StackBlitz " >
266
261
< IconButton
267
262
color = "primary"
268
263
size = "small"
269
264
disableTouchRipple
270
- aria-label = "CodeSandbox playground"
265
+ aria-label = "StackBlitz playground"
271
266
data-ga-event-category = "material-ui-template"
272
267
data-ga-event-label = { templateId }
273
- data-ga-event-action = "codesandbox "
268
+ data-ga-event-action = "stackblitz "
274
269
onClick = { ( ) =>
275
- codeSandbox
270
+ stackBlitz
276
271
. createMaterialTemplate ( {
277
272
...item ,
278
273
files : { ...item . files , ...materialTemplates . sharedTheme ?. files } ,
@@ -291,26 +286,26 @@ function TemplateFrame({ children }) {
291
286
}
292
287
return content ;
293
288
} )
294
- . openSandbox ( `/${ templateName } ` )
289
+ . openStackBlitz ( `/${ templateName } ` )
295
290
}
296
291
sx = { { alignSelf : 'center' , borderRadius : 1 } }
297
292
>
298
- < SvgIcon viewBox = "0 0 1080 1080 " >
299
- < path d = "M755 140.3l0.5-0.3h0.3L512 0 268.3 140h-0.3l0.8 0.4L68.6 256v512L512 1024l443.4-256V256L755 140.3z m-30 506.4v171.2L548 920.1V534.7L883.4 341v215.7l-158.4 90z m-584.4-90.6V340.8L476 534.4v385.7L300 818.5V646.7l-159.4-90.6zM511.7 280l171.1-98.3 166.3 96-336.9 194.5-337-194.6 165.7-95.7L511.7 280z " />
293
+ < SvgIcon viewBox = "0 0 19 28 " >
294
+ < path d = "M8.13378 16.1087H0L14.8696 0L10.8662 11.1522L19 11.1522L4.13043 27.2609L8.13378 16.1087Z " />
300
295
</ SvgIcon >
301
296
</ IconButton >
302
297
</ Tooltip >
303
- < Tooltip title = "Open Template via StackBlitz " >
298
+ < Tooltip title = "Edit in CodeSandbox " >
304
299
< IconButton
305
300
color = "primary"
306
301
size = "small"
307
302
disableTouchRipple
308
- aria-label = "StackBlitz playground"
303
+ aria-label = "CodeSandbox playground"
309
304
data-ga-event-category = "material-ui-template"
310
305
data-ga-event-label = { templateId }
311
- data-ga-event-action = "stackblitz "
306
+ data-ga-event-action = "codesandbox "
312
307
onClick = { ( ) =>
313
- stackBlitz
308
+ codeSandbox
314
309
. createMaterialTemplate ( {
315
310
...item ,
316
311
files : { ...item . files , ...materialTemplates . sharedTheme ?. files } ,
@@ -329,12 +324,12 @@ function TemplateFrame({ children }) {
329
324
}
330
325
return content ;
331
326
} )
332
- . openStackBlitz ( `/${ templateName } ` )
327
+ . openSandbox ( `/${ templateName } ` )
333
328
}
334
329
sx = { { alignSelf : 'center' , borderRadius : 1 } }
335
330
>
336
- < SvgIcon viewBox = "0 0 19 28 " >
337
- < path d = "M8.13378 16.1087H0L14.8696 0L10.8662 11.1522L19 11.1522L4.13043 27.2609L8.13378 16.1087Z " />
331
+ < SvgIcon viewBox = "0 0 1080 1080 " >
332
+ < path d = "M755 140.3l0.5-0.3h0.3L512 0 268.3 140h-0.3l0.8 0.4L68.6 256v512L512 1024l443.4-256V256L755 140.3z m-30 506.4v171.2L548 920.1V534.7L883.4 341v215.7l-158.4 90z m-584.4-90.6V340.8L476 534.4v385.7L300 818.5V646.7l-159.4-90.6zM511.7 280l171.1-98.3 166.3 96-336.9 194.5-337-194.6 165.7-95.7L511.7 280z " />
338
333
</ SvgIcon >
339
334
</ IconButton >
340
335
</ Tooltip >
@@ -358,5 +353,3 @@ function TemplateFrame({ children }) {
358
353
</ ThemeProvider >
359
354
) ;
360
355
}
361
-
362
- export default TemplateFrame ;
0 commit comments