Skip to content

Commit 580e801

Browse files
committed
Lay out elements
1 parent 0da5e7e commit 580e801

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

site/src/components/WorkspaceStatusBar/WorkspaceStatusBar.tsx

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import Box from "@material-ui/core/Box"
2-
import Paper from "@material-ui/core/Paper"
32
import Typography from "@material-ui/core/Typography"
43
import React from "react"
54
import { Link } from "react-router-dom"
65
import { WorkspaceProps } from "../Workspace/Workspace"
76
import CloudCircleIcon from "@material-ui/icons/CloudCircle"
8-
import { CardPadding, CardRadius, TitleIconSize } from "../../theme/constants"
7+
import { TitleIconSize } from "../../theme/constants"
98
import { makeStyles } from "@material-ui/core/styles"
109
import { WorkspaceSection } from "../WorkspaceSection/WorkspaceSection"
10+
import { Stack } from "../Stack/Stack"
11+
import Button from "@material-ui/core/Button"
1112

1213
/**
1314
* Component for the header at the top of the workspace page
@@ -16,33 +17,51 @@ export const WorkspaceStatusBar: React.FC<WorkspaceProps> = ({ organization, tem
1617
const styles = useStyles()
1718

1819
const templateLink = `/templates/${organization.name}/${template.name}`
20+
const action = "Start" // TODO don't let me merge this
21+
const outOfDate = false // TODO
1922

2023
return (
2124
<WorkspaceSection>
25+
<Stack spacing={1}>
26+
<Typography variant="body2" color="textSecondary">
27+
Back to <Link className={styles.link} to={templateLink}>{template.name}</Link>
28+
</Typography>
2229
<div className={styles.horizontal}>
23-
<Box mr="1em">
24-
<CloudCircleIcon width={TitleIconSize} height={TitleIconSize} />
25-
</Box>
26-
<div className={styles.vertical}>
27-
<Typography variant="h4">{workspace.name}</Typography>
28-
<Typography variant="body2" color="textSecondary">
29-
<Link to={templateLink}>{template.name}</Link>
30-
</Typography>
30+
<div className={styles.horizontal}>
31+
<Box mr="1em">
32+
<CloudCircleIcon width={TitleIconSize} height={TitleIconSize} />
33+
</Box>
34+
<div className={styles.vertical}>
35+
<Typography variant="h4">{workspace.name}</Typography>
36+
</div>
37+
</div>
38+
<div className={styles.horizontal}>
39+
<Button color="primary">{action}</Button>
40+
<Button color="primary" disabled={!outOfDate}>Update</Button>
41+
<Link className={styles.link} to={`workspaces/${workspace.id}/edit`}>Settings</Link>
3142
</div>
3243
</div>
44+
</Stack>
3345
</WorkspaceSection>
3446
)
3547
}
3648

3749
const useStyles = makeStyles((theme) => {
3850
return {
51+
link: {
52+
textDecoration: 'none',
53+
color: theme.palette.text.primary
54+
},
3955
icon: {
4056
width: TitleIconSize,
4157
height: TitleIconSize,
4258
},
4359
horizontal: {
4460
display: "flex",
4561
flexDirection: "row",
62+
justifyContent: "space-between",
63+
alignItems: "center",
64+
gap: theme.spacing(1)
4665
},
4766
vertical: {
4867
display: "flex",

0 commit comments

Comments
 (0)