@@ -5,9 +5,11 @@ import MaxWidth from '@codesandbox/common/lib/components/flex/MaxWidth';
55import Column from '@codesandbox/common/lib/components/flex/Column' ;
66import Centered from '@codesandbox/common/lib/components/flex/Centered' ;
77import Padding from '@codesandbox/common/lib/components/spacing/Padding' ;
8-
98import theme from '@codesandbox/common/lib/theme' ;
109import getIcon from '@codesandbox/common/lib/templates/icons' ;
10+ import Tooltip from '@codesandbox/common/lib/components/Tooltip' ;
11+
12+ import ChevronRight from 'react-icons/lib/md/chevron-right' ;
1113
1214import LoadInView from '../../../components/LoadInView' ;
1315import RollingText from '../../../components/RollingText' ;
@@ -148,6 +150,7 @@ const IconContainer = styled.div`
148150
149151 ${ ( { selected, template } ) =>
150152 selected &&
153+ template &&
151154 css `
152155 background-color: ${ template . color . clearer ( 0.9 ) } ;
153156
@@ -213,6 +216,7 @@ const CSSTypes = styled.div`
213216 font-size: 0.875rem;
214217 color: white;
215218 margin-top: 0.5rem;
219+ margin-right: 1rem;
216220` ;
217221
218222const TEMPLATE_SUPPORT = {
@@ -290,6 +294,11 @@ export default class Frameworks extends React.Component {
290294 render ( ) {
291295 const { templates } = this . props ;
292296 const template = templates [ this . state . templateIndex ] ;
297+ const additionalInfo = TEMPLATE_SUPPORT [ template . name ] || {
298+ loaders : [ ] ,
299+ css : [ ] ,
300+ description : `Used for ${ template . niceName } development, based on: ` ,
301+ } ;
293302 const TemplateIcon = getIcon ( template . name ) ;
294303
295304 return (
@@ -314,6 +323,20 @@ export default class Frameworks extends React.Component {
314323 </ IconContainer >
315324 ) ;
316325 } ) }
326+
327+ < Tooltip
328+ delay = { 0 }
329+ placement = "bottom"
330+ content = "Check out other templates"
331+ >
332+ < IconContainer
333+ onClick = { ( ) => {
334+ window . open ( '/s' , '_blank' ) ;
335+ } }
336+ >
337+ < ChevronRight width = { 56 } height = { 56 } />
338+ </ IconContainer >
339+ </ Tooltip >
317340 </ ScrollAtMobile >
318341 </ Icons >
319342
@@ -350,7 +373,7 @@ export default class Frameworks extends React.Component {
350373 fontSize : '.875rem' ,
351374 } }
352375 >
353- { TEMPLATE_SUPPORT [ template . name ] . description }
376+ { additionalInfo . description }
354377 < a
355378 href = { template . url }
356379 target = "_blank"
@@ -362,23 +385,38 @@ export default class Frameworks extends React.Component {
362385 .
363386 </ div >
364387
365- < HeaderTitle > Supported Loaders</ HeaderTitle >
366- < TemplateIcons >
367- { TEMPLATE_SUPPORT [ template . name ] . loaders . map ( ( data , i ) => (
368- < FileType
369- key = { template . name + data . title }
370- iconSrc = { data . svg }
371- title = { data . title }
372- extension = { data . extension }
373- i = { i }
374- />
375- ) ) }
376- </ TemplateIcons >
377-
378- < HeaderTitle > CSS Scoping Support</ HeaderTitle >
379- < CSSTypes >
380- { TEMPLATE_SUPPORT [ template . name ] . css . join ( ', ' ) }
381- </ CSSTypes >
388+ { additionalInfo . loaders . length > 0 && (
389+ < React . Fragment >
390+ < HeaderTitle > Supported Loaders</ HeaderTitle >
391+ < TemplateIcons >
392+ { additionalInfo . loaders . map ( ( data , i ) => (
393+ < FileType
394+ key = { template . name + data . title }
395+ iconSrc = { data . svg }
396+ title = { data . title }
397+ extension = { data . extension }
398+ i = { i }
399+ />
400+ ) ) }
401+ </ TemplateIcons >
402+ </ React . Fragment >
403+ ) }
404+
405+ { additionalInfo . css . length > 0 && (
406+ < React . Fragment >
407+ < HeaderTitle > CSS Scoping Support</ HeaderTitle >
408+ < CSSTypes > { additionalInfo . css . join ( ', ' ) } </ CSSTypes >
409+ </ React . Fragment >
410+ ) }
411+
412+ { template . isServer && (
413+ < React . Fragment >
414+ < HeaderTitle > Container Support</ HeaderTitle >
415+ < CSSTypes >
416+ For this template we run the code on a server.
417+ </ CSSTypes >
418+ </ React . Fragment >
419+ ) }
382420 </ Padding >
383421 </ Container >
384422 </ Flex >
0 commit comments