|
| 1 | +import React from "react" |
| 2 | +import Box from "@material-ui/core/Box" |
| 3 | +import { makeStyles } from "@material-ui/core/styles" |
| 4 | +import Paper from "@material-ui/core/Paper" |
| 5 | +import AddWorkspaceIcon from "@material-ui/icons/AddToQueue" |
| 6 | + |
| 7 | +import { useUser } from "../../contexts/UserContext" |
| 8 | +import { FullScreenLoader } from "../../components/Loader/FullScreenLoader" |
| 9 | + |
| 10 | +const CreateProjectPage: React.FC = () => { |
| 11 | + const styles = useStyles() |
| 12 | + const { me, signOut } = useUser(true) |
| 13 | + |
| 14 | + if (!me) { |
| 15 | + return <FullScreenLoader /> |
| 16 | + } |
| 17 | + |
| 18 | + const createWorkspace = () => { |
| 19 | + alert("create") |
| 20 | + } |
| 21 | + |
| 22 | + const button = { |
| 23 | + children: "New Workspace", |
| 24 | + onClick: createWorkspace, |
| 25 | + } |
| 26 | + |
| 27 | + return ( |
| 28 | + <div className={styles.root}> |
| 29 | + <div className={styles.header}> |
| 30 | + <SplitButton<string> |
| 31 | + color="primary" |
| 32 | + onClick={createWorkspace} |
| 33 | + options={[ |
| 34 | + { |
| 35 | + label: "New workspace", |
| 36 | + value: "custom", |
| 37 | + }, |
| 38 | + { |
| 39 | + label: "New workspace from template", |
| 40 | + value: "template", |
| 41 | + }, |
| 42 | + ]} |
| 43 | + startIcon={<AddWorkspaceIcon />} |
| 44 | + textTransform="none" |
| 45 | + /> |
| 46 | + </div> |
| 47 | + |
| 48 | + <Paper style={{ maxWidth: "1380px", margin: "1em auto", width: "100%" }}> |
| 49 | + <Box pt={4} pb={4}> |
| 50 | + </Box> |
| 51 | + </Paper> |
| 52 | + </div> |
| 53 | + ) |
| 54 | +} |
| 55 | + |
| 56 | +const useStyles = makeStyles((theme) => ({ |
| 57 | + root: { |
| 58 | + display: "flex", |
| 59 | + flexDirection: "column", |
| 60 | + }, |
| 61 | +})) |
| 62 | + |
| 63 | +export default CreateProjectPage |
0 commit comments