Skip to content

Commit d139d7b

Browse files
committed
Add a workspaces component to iterate
1 parent fddfda1 commit d139d7b

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from "react"
2+
3+
import * as API from "../../api"
4+
5+
export interface WorkspaceProps {
6+
workspace: API.Workspace
7+
}
8+
9+
/**
10+
* Workspace is the top-level component for viewing an individual workspace
11+
*/
12+
export const Workspace: React.FC<WorkspaceProps> = ({ workspace }) => {
13+
return <div>Hello, workspace: <span>{workspace.name}</span></div>
14+
}

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"

site/pages/workspaces/[user]/[workspace].tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import { useUser } from "../../../contexts/UserContext"
88
import { firstOrItem } from "../../../util/array"
99
import { ErrorSummary } from "../../../components/ErrorSummary"
1010
import { FullScreenLoader } from "../../../components/Loader/FullScreenLoader"
11-
12-
//import { Workspace } from "../../components/Workspace"
13-
//import { MockWorkspace } from "../../test_helpers"
11+
import { Workspace } from "../../../components/Workspace"
1412

1513
import * as API from "../../../api"
1614

@@ -47,7 +45,7 @@ const WorkspacesPage: React.FC = () => {
4745
<Navbar user={me} onSignOut={signOut} />
4846

4947
<div className={styles.inner}>
50-
<div>Hello, world</div>
48+
<Workspace workspace={workspace} />
5149
</div>
5250

5351
<Footer />

0 commit comments

Comments
 (0)