File tree Expand file tree Collapse file tree 4 files changed +14
-17
lines changed
packages/app/src/app/pages/NewDashboard Expand file tree Collapse file tree 4 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 1- import React from 'react ' ;
1+ import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name ' ;
22import { sandboxUrl } from '@codesandbox/common/lib/utils/url-generator' ;
33import { Element , Link } from '@codesandbox/components' ;
4+ import React from 'react' ;
45
56export const SandboxCard = ( { sandbox } ) => (
67 < Element >
78 < Link href = { sandboxUrl ( { id : sandbox . id , alias : sandbox . alias } ) } >
8- { sandbox . title || sandbox . alias || sandbox . id }
9+ { getSandboxName ( sandbox ) }
910 </ Link >
1011 </ Element >
1112) ;
Original file line number Diff line number Diff line change 1- import React from 'react' ;
2- import { Route , Switch , Redirect , withRouter } from 'react-router-dom' ;
1+ import React , { FunctionComponent } from 'react' ;
2+ import { Redirect , Route , Switch } from 'react-router-dom' ;
33
44// import { RecentSandboxes } from './routes/RecentSandboxes';
55// import PathedSandboxes from './routes/PathedSandboxes';
@@ -12,7 +12,7 @@ import { Element } from '@codesandbox/components';
1212import { StartSandboxes } from './routes/StartSandboxes' ;
1313import { Templates } from './routes/Templates' ;
1414
15- const ContentComponent = ( ) => (
15+ export const Content : FunctionComponent = ( ) => (
1616 < Element style = { { width : 960 , margin : '40px auto' } } >
1717 < Switch >
1818 < Route path = "/new-dashboard/start" component = { StartSandboxes } />
@@ -36,5 +36,3 @@ const ContentComponent = () => (
3636 </ Switch >
3737 </ Element >
3838) ;
39-
40- export const Content = withRouter ( ContentComponent ) ;
Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { FunctionComponent } from 'react' ;
22import css from '@styled-system/css' ;
33import { Element , Text , Button } from '@codesandbox/components' ;
44import { useQuery } from '@apollo/react-hooks' ;
5+
56import { useOvermind } from 'app/overmind' ;
67import {
78 RecentSandboxesQuery ,
@@ -13,7 +14,7 @@ import { LIST_PERSONAL_TEMPLATES } from 'app/components/CreateNewSandbox/queries
1314import { RECENT_SANDBOXES_CONTENT_QUERY } from '../../../queries' ;
1415import { SandboxCard } from '../../../Components/SandboxCard' ;
1516
16- export const StartSandboxes = ( ) => {
17+ export const StartSandboxes : FunctionComponent = ( ) => {
1718 const {
1819 state,
1920 actions : { modalOpened } ,
@@ -49,11 +50,8 @@ export const StartSandboxes = () => {
4950 return < Text > loading</ Text > ;
5051 }
5152
52- const sandboxes = data && data . me && data . me . sandboxes ;
53- const templates =
54- templatesData &&
55- templatesData . me &&
56- templatesData . me . recentlyUsedTemplates . slice ( 0 , 4 ) ;
53+ const sandboxes = data . me . sandboxes ;
54+ const templates = templatesData . me . recentlyUsedTemplates . slice ( 0 , 4 ) ;
5755
5856 return (
5957 < Element >
Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { FunctionComponent } from 'react' ;
22import css from '@styled-system/css' ;
33import { Element , Text } from '@codesandbox/components' ;
44import { useQuery } from '@apollo/react-hooks' ;
99import { LIST_OWNED_TEMPLATES } from 'app/components/CreateNewSandbox/queries' ;
1010import { SandboxCard } from '../../../Components/SandboxCard' ;
1111
12- export const Templates = ( ) => {
12+ export const Templates : FunctionComponent = ( ) => {
1313 const { loading, error, data } = useQuery <
1414 ListTemplatesQuery ,
1515 ListTemplatesQueryVariables
@@ -25,7 +25,7 @@ export const Templates = () => {
2525 return < Text > loading</ Text > ;
2626 }
2727
28- const templates = data && data . me && data . me . templates ;
28+ const templates = data . me . templates ;
2929
3030 return (
3131 < Element >
You can’t perform that action at this time.
0 commit comments