Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Start stubbing out project type
  • Loading branch information
bryphe-coder committed Jan 25, 2022
commit aec1d2e0b40821cadbaa6a4750b51ea655d2e03c
11 changes: 11 additions & 0 deletions site/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ interface LoginResponse {
session_token: string
}

// This must be kept in sync with the `Project` struct in the back-end
export interface Project {
id: string
created_at: string
updated_at: string
organization_id: string
name: string
provisioner: string
active_version_id: string
}

export const login = async (email: string, password: string): Promise<LoginResponse> => {
const response = await fetch("/api/v2/login", {
method: "POST",
Expand Down
31 changes: 23 additions & 8 deletions site/pages/projects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React from "react"
import Box from "@material-ui/core/Box"
import { makeStyles } from "@material-ui/core/styles"
import Paper from "@material-ui/core/Paper"
import Table from "@material-ui/core/Table"
import TableRow from "@material-ui/core/TableRow"
import TableCell from "@material-ui/core/TableCell"

import { EmptyState } from "../../components"
import { Navbar } from "../../components/Navbar"
Expand All @@ -22,11 +25,6 @@ const ProjectsPage: React.FC = () => {
alert("createProject")
}

const button = {
children: "New Project",
onClick: createProject,
}

const action = {
text: "Create Project",
onClick: createProject,
Expand All @@ -37,11 +35,28 @@ const ProjectsPage: React.FC = () => {
<Navbar user={me} />

<Header title="Projects" description="View available projects" subTitle="0 total" action={action} />

<Paper style={{ maxWidth: "1380px", margin: "1em auto", width: "100%" }}>
<Box pt={4} pb={4}>
<EmptyState message="No projects available." button={button} />
</Box>
<Table>
<TableRow>
<TableCell colSpan={999}>
<Box p={4}>
<EmptyState
button={{
children: "Create Project",
//icon: AddPhotoIcon,
onClick: createProject,
}}
message="No projects have been created yet"
description="Create a project to get started."
/>
</Box>
</TableCell>
</TableRow>

</Table>
</Paper>

<Footer />
</div>
)
Expand Down