Skip to content

Commit 8cbd09d

Browse files
committed
First round of clean-up
1 parent 1e3eece commit 8cbd09d

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

site/components/Workspace/Workspace.stories.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ import { MockWorkspace } from "../../test_helpers"
66
export default {
77
title: "Workspace",
88
component: Workspace,
9-
argTypes: {
10-
11-
},
9+
argTypes: {},
1210
}
1311

1412
const Template: Story<WorkspaceProps> = (args) => <Workspace {...args} />
1513

1614
export const Example = Template.bind({})
1715
Example.args = {
18-
workspace: MockWorkspace
19-
}
16+
workspace: MockWorkspace,
17+
}

site/components/Workspace/Workspace.tsx

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { Box, Paper, Typography, Link as MuiLink } from "@material-ui/core"
1+
import Box from "@material-ui/core/Box"
2+
import Paper from "@material-ui/core/Paper"
3+
import Typography from "@material-ui/core/Typography"
24
import { makeStyles } from "@material-ui/core/styles"
35
import CloudCircleIcon from "@material-ui/icons/CloudCircle"
46
import Link from "next/link"
@@ -21,7 +23,21 @@ namespace Constants {
2123
*/
2224
export const Workspace: React.FC<WorkspaceProps> = ({ workspace }) => {
2325
const styles = useStyles()
24-
return <div className={styles.root}>
26+
27+
return (
28+
<div className={styles.root}>
29+
<WorkspaceHeader workspace={workspace} />
30+
</div>
31+
)
32+
}
33+
34+
/**
35+
* Component for the header at the top of the workspace page
36+
*/
37+
export const WorkspaceHeader: React.FC<WorkspaceProps> = ({ workspace }) => {
38+
const styles = useStyles()
39+
40+
return (
2541
<Paper elevation={0} className={styles.section}>
2642
<div className={styles.horizontal}>
2743
<WorkspaceHeroIcon />
@@ -33,14 +49,18 @@ export const Workspace: React.FC<WorkspaceProps> = ({ workspace }) => {
3349
</div>
3450
</div>
3551
</Paper>
36-
</div>
52+
)
3753
}
3854

39-
// Component to render the 'Hero Icon' in the header of a workspace
40-
export const WorkspaceHeroIcon = () => {
41-
return <Box mr={"1em"}>
42-
<CloudCircleIcon width={Constants.TitleIconSize} height={Constants.TitleIconSize} />
43-
</Box>
55+
/**
56+
* Component to render the 'Hero Icon' in the header of a workspace
57+
*/
58+
export const WorkspaceHeroIcon: React.FC = () => {
59+
return (
60+
<Box mr={"1em"}>
61+
<CloudCircleIcon width={Constants.TitleIconSize} height={Constants.TitleIconSize} />
62+
</Box>
63+
)
4464
}
4565

4666
export const useStyles = makeStyles((theme) => {
@@ -65,6 +85,6 @@ export const useStyles = makeStyles((theme) => {
6585
icon: {
6686
width: Constants.TitleIconSize,
6787
height: Constants.TitleIconSize,
68-
}
88+
},
6989
}
70-
})
90+
})

site/components/Workspace/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "./Workspace"
1+
export * from "./Workspace"

0 commit comments

Comments
 (0)