File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
packages/app/src/app/pages/Dashboard/Content Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -6,22 +6,26 @@ import { Filters } from './Filters';
66import { DashboardActions } from './Actions' ;
77import { ITemplate } from './types' ;
88
9- interface Props {
9+ interface IContentProps {
1010 sandboxes : any [ ] ;
11- Header : React . ComponentType ;
12- SubHeader : React . ComponentType ;
13- ExtraElement : React . ComponentType ;
11+ Header : React . ComponentType | string ;
12+ SubHeader ? : React . ComponentType ;
13+ ExtraElement : React . ComponentType < IExtraElementProps > ;
1414
15- possibleTemplates : ITemplate [ ] ;
15+ possibleTemplates ? : ITemplate [ ] ;
1616 isLoading ?: boolean ;
1717 hideOrder ?: boolean ;
1818 hideFilters ?: boolean ;
19- page ?: number ;
19+ page ?: number | string ;
2020 actions ?: any [ ] ;
2121}
2222
23+ interface IExtraElementProps {
24+ style : React . CSSProperties ;
25+ }
26+
2327// eslint-disable-next-line react/prefer-stateless-function
24- export class Content extends React . Component < Props > {
28+ export class Content extends React . Component < IContentProps > {
2529 render ( ) {
2630 const {
2731 sandboxes,
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import Helmet from 'react-helmet' ;
2+ import { Helmet } from 'react-helmet' ;
33import { useQuery } from '@apollo/react-hooks' ;
44
55import { useOvermind } from 'app/overmind' ;
@@ -16,6 +16,11 @@ export const RecentSandboxes = () => {
1616 orderDirection : state . dashboard . orderBy . order . toUpperCase ( ) ,
1717 } ,
1818 } ) ;
19+
20+ if ( error ) {
21+ return < div > Error!</ div > ;
22+ }
23+
1924 const sandboxes = loading ? [ ] : ( data && data . me && data . me . sandboxes ) || [ ] ;
2025
2126 let mostUsedTemplate = null ;
@@ -28,13 +33,11 @@ export const RecentSandboxes = () => {
2833 // We want to hide all templates
2934 // TODO: make this a query variable for graphql and move the logic to the server
3035 const noTemplateSandboxes = sandboxes . filter ( s => ! s . customTemplate ) ;
31-
3236 return (
3337 < >
3438 < Helmet >
3539 < title > Recent Sandboxes - CodeSandbox</ title >
3640 </ Helmet >
37- { error && < div > Error!</ div > }
3841 < Sandboxes
3942 isLoading = { loading }
4043 Header = "Recent Sandboxes"
You can’t perform that action at this time.
0 commit comments