diff --git a/client/src/components/AppFileList.tsx b/client/src/components/AppFileList.tsx index 6a05a64..ce15934 100644 --- a/client/src/components/AppFileList.tsx +++ b/client/src/components/AppFileList.tsx @@ -3,6 +3,7 @@ import { AppFile } from "../types/AppFile"; import { FileCollection } from "./FileCollection"; import { InputFile } from "./InputFile"; import { FilterBar } from "./FilterBar"; +import { Grid, Typography } from "@material-ui/core"; type IProps = { files: AppFile[]; @@ -18,14 +19,20 @@ export const FileList: FC = ({ files }) => { }; return ( <> -
-

Files

- -
+ + + + Files + + + + + + diff --git a/client/src/components/AvatarList.tsx b/client/src/components/AvatarList.tsx index e13fef7..adc2eea 100644 --- a/client/src/components/AvatarList.tsx +++ b/client/src/components/AvatarList.tsx @@ -13,7 +13,7 @@ export const AvatarList: FC = ({ users }) => { <> ) : ( <> - + {users.map((user: User, i: number) => ( diff --git a/client/src/components/InputFile.tsx b/client/src/components/InputFile.tsx index 7e3418a..c4257e7 100644 --- a/client/src/components/InputFile.tsx +++ b/client/src/components/InputFile.tsx @@ -1,27 +1,62 @@ import React, { FC } from "react"; +import { CloudUpload } from "@material-ui/icons"; +import { makeStyles, createStyles, Theme } from "@material-ui/core/styles"; +import Button from "@material-ui/core/Button"; export const InputFile: FC = () => { return ( <>
-
- cloud_upload + + -
-
- -
+
); }; + +const useStyles = makeStyles((theme: Theme) => + createStyles({ + root: { + "& > *": { + margin: theme.spacing(1) + } + }, + input: { + display: "none" + } + }) +); + +const UploadButton: FC = () => { + const classes = useStyles(); + + return ( +
+ + +
+ ); +}; diff --git a/client/src/components/ProjectTabPanel.tsx b/client/src/components/ProjectTabPanel.tsx new file mode 100644 index 0000000..f763a98 --- /dev/null +++ b/client/src/components/ProjectTabPanel.tsx @@ -0,0 +1,110 @@ +import React, { FC } from "react"; +import SwipeableViews from "react-swipeable-views"; +import { makeStyles, Theme, useTheme } from "@material-ui/core/styles"; +import AppBar from "@material-ui/core/AppBar"; +import Tabs from "@material-ui/core/Tabs"; +import Tab from "@material-ui/core/Tab"; +import Typography from "@material-ui/core/Typography"; +import Box from "@material-ui/core/Box"; +import { Ticket } from "../types/Ticket"; +import { Project } from "../types/Project"; +import { FileList } from "./AppFileList"; +import { TicketList } from "./TicketList"; +import { AppFile } from "../types/AppFile"; + +interface TabProps { + children?: React.ReactNode; + dir?: string; + index: any; + value: any; +} + +const TabPanel: FC = (props: TabProps) => { + const { children, value, index, ...other } = props; + + return ( + + ); +}; + +const a11yProps = (index: any) => { + return { + id: `full-width-tab-${index}`, + "aria-controls": `full-width-tabpanel-${index}` + }; +}; + +const useStyles = makeStyles((theme: Theme) => ({ + root: { + backgroundColor: "#ffffff", + flexGrow: 1 + } +})); + +interface IProps { + tickets: Ticket[]; + remainingDays?: number; + tabNames: string[]; + files: AppFile[]; + // activities: Activity[]; + allProjects: Project[]; +} + +export const ProjectTabPanel: FC = ({ + tickets, + tabNames, + files + // allProjects +}) => { + const classes = useStyles(); + const theme = useTheme(); + const [value, setValue] = React.useState(0); + + const handleChange = (event: React.ChangeEvent<{}>, newValue: number) => { + setValue(newValue); + }; + + const handleChangeIndex = (index: number) => { + setValue(index); + }; + + return ( +
+ + + {tabNames.map((t: string, i: number) => ( + + ))} + + + + + + + + + + +
+ ); +}; diff --git a/client/src/components/TicketList.tsx b/client/src/components/TicketList.tsx index 94fcfae..d780d93 100644 --- a/client/src/components/TicketList.tsx +++ b/client/src/components/TicketList.tsx @@ -42,58 +42,56 @@ export const TicketList: FC = ({ ); return ( <> -
- { - setShowNew(false); - }} - show={showNew} - allProjects={allProjects} - /> + { + setShowNew(false); + }} + show={showNew} + allProjects={allProjects} + /> - - - - Tickets - - - - {addButton && ( - - )} - - - - - -
- {filteredTickets.length === 0 ? ( - - ) : ( - filteredTickets.map((t: Ticket) => ( - { - e.preventDefault(); - await put>( - `${Constants.ticketsURI}/${t.id}/closed`, - {} - ); - }} - /> - )) - )} -
-
+ + + + Tickets + -
+ + {addButton && ( + + )} + + + + + +
+ {filteredTickets.length === 0 ? ( + + ) : ( + filteredTickets.map((t: Ticket) => ( + { + e.preventDefault(); + await put>( + `${Constants.ticketsURI}/${t.id}/closed`, + {} + ); + }} + /> + )) + )} +
+
+ ); }; diff --git a/client/src/pages/ProjectPage.tsx b/client/src/pages/ProjectPage.tsx index f6c61fb..000603e 100644 --- a/client/src/pages/ProjectPage.tsx +++ b/client/src/pages/ProjectPage.tsx @@ -6,6 +6,8 @@ import { ProgressBar } from "../components/ProgressBar"; import { TabRouter } from "../components/TabRouter"; import { FloatingButton } from "../components/FloatingButton"; import { UsersModal } from "../components/UsersModal"; +import { Container, Grid } from "@material-ui/core"; +import { ProjectTabPanel } from "../components/ProjectTabPanel"; interface IProps { viewModel: ProjectVM; @@ -32,38 +34,43 @@ export const ProjectPage: FC = ({ viewModel }) => { const [showModal, setShowModal] = useState(false); return ( -
-
-
-
+ +
+ setShowModal(false)} + /> + + + + + setShowModal(true)} /> - setShowModal(false)} - /> -
- - -
-
+ + + + + + + ); };