1
+ import { Link } from "@material-ui/core"
1
2
import Avatar from "@material-ui/core/Avatar"
2
3
import Button from "@material-ui/core/Button"
3
4
import { makeStyles , Theme } from "@material-ui/core/styles"
@@ -11,7 +12,7 @@ import useTheme from "@material-ui/styles/useTheme"
11
12
import dayjs from "dayjs"
12
13
import relativeTime from "dayjs/plugin/relativeTime"
13
14
import React from "react"
14
- import { Link } from "react-router-dom"
15
+ import { Link as RouterLink } from "react-router-dom"
15
16
import * as TypesGen from "../../api/typesGenerated"
16
17
import { WorkspaceBuild } from "../../api/typesGenerated"
17
18
import { Margins } from "../../components/Margins/Margins"
@@ -50,14 +51,28 @@ export const WorkspacesPageView: React.FC<WorkspacesPageViewProps> = (props) =>
50
51
</ TableRow >
51
52
</ TableHead >
52
53
< TableBody >
54
+ { ! props . workspaces && (
55
+ < TableRow >
56
+ < TableCell colSpan = { 999 } >
57
+ < div className = { styles . welcome } >
58
+ < span >
59
+ < Link component = { RouterLink } to = "/workspaces/new" >
60
+ Create a workspace
61
+ </ Link >
62
+ so you can check out your repositories, edit your source code, and build and test your software.
63
+ </ span >
64
+ </ div >
65
+ </ TableCell >
66
+ </ TableRow >
67
+ ) }
53
68
{ props . workspaces ?. map ( ( workspace ) => (
54
69
< TableRow key = { workspace . id } className = { styles . workspaceRow } >
55
70
< TableCell >
56
71
< div className = { styles . workspaceName } >
57
72
< Avatar variant = "square" className = { styles . workspaceAvatar } >
58
73
{ firstLetter ( workspace . name ) }
59
74
</ Avatar >
60
- < Link to = { `/workspaces/${ workspace . id } ` } className = { styles . workspaceLink } >
75
+ < Link component = { RouterLink } to = { `/workspaces/${ workspace . id } ` } className = { styles . workspaceLink } >
61
76
< b > { workspace . name } </ b >
62
77
< span > { workspace . owner_name } </ span >
63
78
</ Link >
@@ -139,6 +154,20 @@ const useStyles = makeStyles((theme) => ({
139
154
marginLeft : "auto" ,
140
155
} ,
141
156
} ,
157
+ welcome : {
158
+ paddingTop : theme . spacing ( 12 ) ,
159
+ paddingBottom : theme . spacing ( 12 ) ,
160
+ display : "flex" ,
161
+ flexDirection : "column" ,
162
+ alignItems : "center" ,
163
+ justifyContent : "center" ,
164
+ "& span" : {
165
+ maxWidth : 600 ,
166
+ textAlign : "center" ,
167
+ fontSize : theme . spacing ( 2 ) ,
168
+ lineHeight : `${ theme . spacing ( 3 ) } px` ,
169
+ } ,
170
+ } ,
142
171
workspaceRow : {
143
172
"& > td" : {
144
173
paddingTop : theme . spacing ( 2 ) ,
0 commit comments