|
1 | 1 | import React, { useState } from "react"
|
2 |
| -import { AddToQueue as AddWorkspaceIcon } from "@material-ui/icons" |
3 |
| - |
4 |
| -import { Confetti, EmptyState, Page, SplitButton } from "./../components" |
5 |
| - |
6 | 2 | import { Dialog, DialogActions, Button, DialogTitle, DialogContent, makeStyles, Box, Paper } from "@material-ui/core"
|
| 3 | +import { AddToQueue as AddWorkspaceIcon } from "@material-ui/icons" |
7 | 4 |
|
8 |
| -const useStyles2 = makeStyles((theme) => ({ |
9 |
| - "@keyframes spin": { |
10 |
| - from: { |
11 |
| - transform: "rotateY(0deg)", |
12 |
| - }, |
13 |
| - to: { |
14 |
| - transform: "rotateY(180deg)", |
15 |
| - }, |
16 |
| - }, |
17 |
| - triangle: { |
18 |
| - animation: "$spin 1s ease-in-out infinite alternate both", |
19 |
| - }, |
20 |
| -})) |
21 |
| - |
22 |
| -export const Triangle: React.FC = () => { |
23 |
| - const size = 100 |
24 |
| - |
25 |
| - const styles = useStyles2() |
26 |
| - |
27 |
| - const transparent = `${size}px solid transparent` |
28 |
| - const colored = `${size / 0.86}px solid black` |
| 5 | +import { EmptyState, Page, SplitButton } from "./../components" |
29 | 6 |
|
30 |
| - return ( |
31 |
| - <div |
32 |
| - className={styles.triangle} |
33 |
| - style={{ |
34 |
| - width: 0, |
35 |
| - height: 0, |
36 |
| - borderLeft: transparent, |
37 |
| - borderRight: transparent, |
38 |
| - borderBottom: colored, |
39 |
| - }} |
40 |
| - /> |
41 |
| - ) |
42 |
| -} |
| 7 | +import { CreateWorkspace } from "./CreateWorkspace" |
43 | 8 |
|
44 | 9 | export const Workspaces: React.FC = () => {
|
45 | 10 | const styles = useStyles()
|
@@ -84,31 +49,26 @@ export const Workspaces: React.FC = () => {
|
84 | 49 | <EmptyState message="No workspaces available." button={button} />
|
85 | 50 | </Box>
|
86 | 51 | </Paper>
|
87 |
| - <Dialog fullWidth={true} maxWidth={"lg"} open={open} onClose={handleClose}> |
88 |
| - <DialogTitle>New Workspace</DialogTitle> |
89 |
| - <DialogContent> |
90 |
| - <Confetti |
91 |
| - style={{ |
92 |
| - minHeight: "500px", |
93 |
| - display: "flex", |
94 |
| - flexDirection: "column", |
95 |
| - justifyContent: "center", |
96 |
| - alignItems: "center", |
97 |
| - }} |
98 |
| - > |
99 |
| - <Triangle /> |
100 | 52 |
|
101 |
| - <Box m={"2em"}>NEXT STEP: Let's create a workspace with a v2 provisioner!</Box> |
102 |
| - </Confetti> |
103 |
| - </DialogContent> |
104 |
| - <DialogActions> |
105 |
| - <Button onClick={handleClose}>Close</Button> |
106 |
| - </DialogActions> |
107 |
| - </Dialog> |
| 53 | + <CreateDialog open={open} handleClose={handleClose} /> |
108 | 54 | </Page>
|
109 | 55 | )
|
110 | 56 | }
|
111 | 57 |
|
| 58 | +const CreateDialog: React.FC<{ open: boolean; handleClose: () => void }> = ({ open, handleClose }) => { |
| 59 | + return ( |
| 60 | + <Dialog fullWidth={true} maxWidth={"lg"} open={open} onClose={handleClose}> |
| 61 | + <DialogTitle>New Workspace</DialogTitle> |
| 62 | + <DialogContent> |
| 63 | + <CreateWorkspace /> |
| 64 | + </DialogContent> |
| 65 | + <DialogActions> |
| 66 | + <Button onClick={handleClose}>Close</Button> |
| 67 | + </DialogActions> |
| 68 | + </Dialog> |
| 69 | + ) |
| 70 | +} |
| 71 | + |
112 | 72 | const useStyles = makeStyles((theme) => ({
|
113 | 73 | header: {
|
114 | 74 | display: "flex",
|
|
0 commit comments