From e073c59b2c7f556bf5267c4f44e20bc713f39f38 Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Fri, 17 Apr 2020 16:09:58 +0200 Subject: [PATCH] [UI] updated New Ticket Modal --- client/src/components/Modals/Modal.tsx | 2 +- .../src/components/Modals/NewTicketModal.tsx | 119 ++++++++++-------- client/src/components/NewTicketForm.tsx | 37 +----- 3 files changed, 74 insertions(+), 84 deletions(-) diff --git a/client/src/components/Modals/Modal.tsx b/client/src/components/Modals/Modal.tsx index 734f942..f52ad5e 100644 --- a/client/src/components/Modals/Modal.tsx +++ b/client/src/components/Modals/Modal.tsx @@ -47,7 +47,7 @@ export const Modal: FC = ({ const classes = useStyles(); return ( - + {name} {handleClose ? ( diff --git a/client/src/components/Modals/NewTicketModal.tsx b/client/src/components/Modals/NewTicketModal.tsx index 96056c2..1fedf93 100644 --- a/client/src/components/Modals/NewTicketModal.tsx +++ b/client/src/components/Modals/NewTicketModal.tsx @@ -6,21 +6,7 @@ import { Ticket } from "../../types/Ticket"; import { Project } from "../../types/Project"; import { post } from "../../utils/http"; import { Constants } from "../../utils/Constants"; -import { - DialogTitle, - DialogContent, - DialogContentText, - TextField, - DialogActions, - Button, - Typography, - IconButton, - Theme, - createStyles, - makeStyles, -} from "@material-ui/core"; -import MuiDialogTitle from "@material-ui/core/DialogTitle"; -import MuiDialogContent from "@material-ui/core/DialogContent"; +import { TextField, MenuItem } from "@material-ui/core"; interface IProps { show: boolean; @@ -64,44 +50,75 @@ export const NewTicketModal: FC = ({ action="New Ticket" handleAction={handleSubmit} > -
- {/*
-

New Ticket

-
*/} + {/*
*/} +
+ ) => + setTitle(e.target.value) + } + autoFocus + /> -
- - close - -
+ ) => + setDescription(e.target.value) + } + multiline + /> + + ) => + setEndingDate(e.target.value) + } + /> + + ) => { + e.preventDefault(); + setProjectId(e.target.value); + }} + // helperText="Please select your currency" + variant="outlined" + > + {allProjects.map((p) => ( + + {p.title} + + ))} +
- - -
- -
- -
- -
-
+ {/* */} ); }; diff --git a/client/src/components/NewTicketForm.tsx b/client/src/components/NewTicketForm.tsx index 97e0108..aac5205 100644 --- a/client/src/components/NewTicketForm.tsx +++ b/client/src/components/NewTicketForm.tsx @@ -1,4 +1,5 @@ import React, { FC } from "react"; +import { TextField, MenuItem } from "@material-ui/core"; import { Project } from "../types/Project"; interface IProps { @@ -22,45 +23,17 @@ export const NewTicketForm: FC = ({ setEndingDate, allProjects, projectId, - setProjectId + setProjectId, }) => { return ( <> -
-
- note_add - ) => - setTitle(e.target.value) - } - /> - -
- -
- mode_edit - - -
- + {/*
date_range ) => setEndingDate(e.target.value) } @@ -81,14 +54,14 @@ export const NewTicketForm: FC = ({ - {allProjects.map(p => ( + {allProjects.map((p) => ( ))}
-
+
*/} ); };