Skip to content

Commit a512f16

Browse files
committed
Workspace stub
1 parent f970e35 commit a512f16

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import Paper from "@material-ui/core/Paper"
2+
import { makeStyles } from "@material-ui/core/styles"
3+
import React from "react"
4+
5+
import * as API from "../../api"
6+
7+
export interface WorkspaceProps {
8+
workspace: API.Workspace
9+
}
10+
11+
export const Workspace: React.FC<WorkspaceProps> = ({ workspace }) => {
12+
const styles = useStyles()
13+
14+
return <div className={styles.root}>
15+
<Paper elevation={0} className={styles.section}>
16+
<div>Hello</div>
17+
</Paper>
18+
<div className={styles.horizontal}>
19+
<Paper elevation={0} className={styles.sideBar}>
20+
<div>Apps</div>
21+
</Paper>
22+
<Paper elevation={0} className={styles.main}>
23+
<div>Build stuff</div>
24+
</Paper>
25+
</div>
26+
</div>
27+
}
28+
29+
namespace Constants {
30+
export const CardRadius = 8
31+
export const CardPadding = 20
32+
}
33+
34+
export const useStyles = makeStyles((theme) => {
35+
36+
const common = {
37+
border: `1px solid ${theme.palette.divider}`,
38+
borderRadius: Constants.CardRadius,
39+
margin: theme.spacing(1),
40+
padding: Constants.CardPadding
41+
}
42+
43+
return {
44+
root: {
45+
display: "flex",
46+
flexDirection: "column"
47+
},
48+
horizontal: {
49+
display: "flex",
50+
flexDirection: "row"
51+
},
52+
section: common,
53+
sideBar: {
54+
...common,
55+
width: "400px"
56+
},
57+
main: {
58+
...common,
59+
flex: 1
60+
}
61+
}
62+
})

site/components/Workspace/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./Workspace"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React from "react"
2+
import { makeStyles } from "@material-ui/core/styles"
3+
import Paper from "@material-ui/core/Paper"
4+
import { useRouter } from "next/router"
5+
import Link from "next/link"
6+
import { Navbar } from "../../../../components/Navbar"
7+
import { Footer } from "../../../../components/Page"
8+
import { useUser } from "../../../../contexts/UserContext"
9+
10+
import { Workspace } from "../../../../components/Workspace"
11+
import { MockWorkspace } from "../../../../test_helpers"
12+
13+
14+
const ProjectsPage: React.FC = () => {
15+
const styles = useStyles()
16+
const router = useRouter()
17+
const { me, signOut } = useUser(true)
18+
19+
const { user, workspace } = router.query
20+
21+
return (
22+
<div className={styles.root}>
23+
<Navbar user={me} onSignOut={signOut} />
24+
25+
<div className={styles.inner}>
26+
<Workspace workspace={MockWorkspace} />
27+
</div>
28+
29+
<Footer />
30+
</div>
31+
)
32+
}
33+
34+
const useStyles = makeStyles(() => ({
35+
root: {
36+
display: "flex",
37+
flexDirection: "column",
38+
},
39+
inner: {
40+
maxWidth: "1380px",
41+
margin: "1em auto",
42+
width: "100%"
43+
}
44+
}))
45+
46+
export default ProjectsPage

0 commit comments

Comments
 (0)