Skip to content

Commit 53ff325

Browse files
committed
More prototyping
1 parent 8b73c2c commit 53ff325

File tree

1 file changed

+39
-10
lines changed

1 file changed

+39
-10
lines changed

site/components/Workspace/Workspace.tsx

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import Box from "@material-ui/core/Box"
12
import Paper from "@material-ui/core/Paper"
23
import { makeStyles } from "@material-ui/core/styles"
34
import Typography from "@material-ui/core/Typography"
45
import OpenInNewIcon from "@material-ui/icons/OpenInNew"
5-
import React from "react"
6+
import React, { useState } from "react"
67
import MoreVertIcon from "@material-ui/icons/MoreVert"
78
import { QuestionHelp } from "../QuestionHelp"
8-
import { CircularProgress, IconButton, Link } from "@material-ui/core"
9+
import { CircularProgress, IconButton, Link, Menu, MenuItem } from "@material-ui/core"
910

1011
import { Timeline as TestTimeline } from "../Timeline"
1112

@@ -62,6 +63,8 @@ const ResourceIconSize = 20
6263
export const ResourceRow: React.FC<ResourceRowProps> = ({ icon, href, name, status }) => {
6364
const styles = useResourceRowStyles()
6465

66+
const [menuAnchorEl, setMenuAnchorEl] = useState<HTMLElement | null>(null)
67+
6568
return (
6669
<div className={styles.root}>
6770
<div className={styles.iconContainer}>
@@ -87,9 +90,26 @@ export const ResourceRow: React.FC<ResourceRowProps> = ({ icon, href, name, stat
8790
<StatusIndicator status={status} />
8891
</div>
8992
<div>
90-
<IconButton size="small" className={styles.action}>
93+
<IconButton size="small" className={styles.action} onClick={(ev) => setMenuAnchorEl(ev.currentTarget)}>
9194
<MoreVertIcon fontSize="inherit" />
9295
</IconButton>
96+
97+
<Menu anchorEl={menuAnchorEl} open={!!menuAnchorEl} onClose={() => setMenuAnchorEl(undefined)}>
98+
<MenuItem
99+
onClick={() => {
100+
setMenuAnchorEl(undefined)
101+
}}
102+
>
103+
SSH
104+
</MenuItem>
105+
<MenuItem
106+
onClick={() => {
107+
setMenuAnchorEl(undefined)
108+
}}
109+
>
110+
Remote Desktop
111+
</MenuItem>
112+
</Menu>
93113
</div>
94114
</div>
95115
)
@@ -152,18 +172,27 @@ const useTitleStyles = makeStyles((theme) => ({
152172
},
153173
}))
154174

175+
const TitleIconSize = 48
176+
155177
export const Workspace: React.FC<WorkspaceProps> = ({ workspace }) => {
156178
const styles = useStyles()
157179

158180
return (
159181
<div className={styles.root}>
160182
<Paper elevation={0} className={styles.section}>
161-
<Typography variant="h4">{workspace.name}</Typography>
162-
<Typography variant="body2" color="textSecondary">
163-
<Link>test-org</Link>
164-
{" / "}
165-
<Link>test-project</Link>
166-
</Typography>
183+
<div className={styles.horizontal}>
184+
<Box mr={"1em"}>
185+
<img src={"/static/discord-logo.svg"} height={TitleIconSize} width={TitleIconSize} />
186+
</Box>
187+
<div className={styles.vertical}>
188+
<Typography variant="h4">{workspace.name}</Typography>
189+
<Typography variant="body2" color="textSecondary">
190+
<Link>test-org</Link>
191+
{" / "}
192+
<Link>test-project</Link>
193+
</Typography>
194+
</div>
195+
</div>
167196
</Paper>
168197
<div className={styles.horizontal}>
169198
<div className={styles.sideBar}>
@@ -178,7 +207,7 @@ export const Workspace: React.FC<WorkspaceProps> = ({ workspace }) => {
178207
<div className={styles.vertical}>
179208
<ResourceRow name={"Code Web"} icon={"/static/vscode.svg"} href={"placeholder"} status={"active"} />
180209
<ResourceRow name={"Terminal"} icon={"/static/terminal.svg"} href={"placeholder"} status={"active"} />
181-
<ResourceRow name={"React App"} icon={"/static/react-icon.svg"} status={"active"} />
210+
<ResourceRow name={"React App"} icon={"/static/react-icon.svg"} href={"placeholder"} status={"active"} />
182211
</div>
183212
</Paper>
184213
<Paper elevation={0} className={styles.section}>

0 commit comments

Comments
 (0)