From 597c8066ae2990ce4c1b1458598a275044ee73e4 Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Fri, 3 Apr 2020 12:22:48 +0200 Subject: [PATCH] update projectlist --- client/src/App.tsx | 2 +- client/src/authentication/auth0.tsx | 2 +- client/src/components/HorizontalCard.tsx | 1 - client/src/components/ProjectList.tsx | 75 ++++++++++++------------ client/src/components/UserTabPanel.tsx | 5 +- client/src/pages/Layout.tsx | 21 +++---- client/src/pages/UserPage.tsx | 1 - client/src/utils/router.tsx | 4 +- 8 files changed, 53 insertions(+), 58 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index e3b5f69..f388612 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import React from "react"; import { Router } from "react-router-dom"; import * as createHistory from "history"; import Layout from "./pages/Layout"; diff --git a/client/src/authentication/auth0.tsx b/client/src/authentication/auth0.tsx index bb85f11..6be8707 100644 --- a/client/src/authentication/auth0.tsx +++ b/client/src/authentication/auth0.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useContext, FC } from "react"; +import React, { useState, useEffect, useContext } from "react"; import createAuth0Client from "@auth0/auth0-spa-js"; import Auth0Client from "@auth0/auth0-spa-js/dist/typings/Auth0Client"; diff --git a/client/src/components/HorizontalCard.tsx b/client/src/components/HorizontalCard.tsx index 62a71ea..6f0a7cc 100644 --- a/client/src/components/HorizontalCard.tsx +++ b/client/src/components/HorizontalCard.tsx @@ -39,7 +39,6 @@ export const HorizontalCard: FC = ({ validateTicket }) => { const classes = useStyles(); - const bull = ; return ( diff --git a/client/src/components/ProjectList.tsx b/client/src/components/ProjectList.tsx index 2c5c406..e6bcf93 100644 --- a/client/src/components/ProjectList.tsx +++ b/client/src/components/ProjectList.tsx @@ -6,7 +6,7 @@ import { put } from "../utils/http"; import { Constants } from "../utils/Constants"; import { HttpResponse } from "../types/HttpResponse"; import { Project } from "../types/Project"; -import { Container, Typography, Grid } from "@material-ui/core"; +import { Typography, Grid } from "@material-ui/core"; type IProps = { projects: Project[]; @@ -27,43 +27,44 @@ export const ProjectList: FC = ({ projects }) => { t.status !== "Done" && t.title.toLowerCase().includes(filterText.toLowerCase()) ); + return ( - <> - - - - Projects - - - - - + + + + Projects + -
- {filteredTickets.length === 0 ? ( - - ) : ( - filteredTickets.map((t: Project) => ( - { - e.preventDefault(); - await put>( - `${Constants.ticketsURI}/${t.id}/closed`, - {} - ); - }} - /> - )) - )} -
- + + + + +
+ {filteredTickets.length === 0 ? ( + + ) : ( + filteredTickets.map((t: Project) => ( + { + e.preventDefault(); + await put>( + `${Constants.ticketsURI}/${t.id}/closed`, + {} + ); + }} + /> + )) + )} +
+
+
); }; diff --git a/client/src/components/UserTabPanel.tsx b/client/src/components/UserTabPanel.tsx index 0164010..604dfb9 100644 --- a/client/src/components/UserTabPanel.tsx +++ b/client/src/components/UserTabPanel.tsx @@ -6,7 +6,6 @@ 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 { Header } from "./Header"; import { Ticket } from "../types/Ticket"; import { Project } from "../types/Project"; import { ProjectList } from "./ProjectList"; @@ -45,7 +44,7 @@ const a11yProps = (index: any) => { const useStyles = makeStyles((theme: Theme) => ({ root: { - backgroundColor: theme.palette.background.paper, + backgroundColor: "#ffffff", flexGrow: 1 } })); @@ -81,7 +80,7 @@ export const UserTabPanel: FC = ({ tickets, tabNames, projects }) => { aria-label="full width tabs example" > {tabNames.map((t: string, i: number) => ( - + ))} diff --git a/client/src/pages/Layout.tsx b/client/src/pages/Layout.tsx index f7e8a1e..91c8d23 100644 --- a/client/src/pages/Layout.tsx +++ b/client/src/pages/Layout.tsx @@ -1,5 +1,4 @@ -import React, { FC } from "react"; - +import React from "react"; import CssBaseline from "@material-ui/core/CssBaseline"; import { makeStyles } from "@material-ui/core/styles"; import { AppRouter } from "../utils/router"; @@ -21,16 +20,14 @@ const useStyles = makeStyles(theme => ({ export default function Layout() { const classes = useStyles(); return ( -
-
-
- -
- {/* */} - - -
-
+
+
+ +
+ {/* */} + + +
); } diff --git a/client/src/pages/UserPage.tsx b/client/src/pages/UserPage.tsx index ea2df6c..6e4f9e4 100644 --- a/client/src/pages/UserPage.tsx +++ b/client/src/pages/UserPage.tsx @@ -1,7 +1,6 @@ import React, { FC } from "react"; import { UserVM } from "../VM/UserVM"; import { UserHeader } from "../components/UserHeader"; -import { UserTabRouter } from "../components/UserTabRouter"; import { UserTabPanel } from "../components/UserTabPanel"; import { Container } from "@material-ui/core"; diff --git a/client/src/utils/router.tsx b/client/src/utils/router.tsx index f0c5950..d2d63c8 100644 --- a/client/src/utils/router.tsx +++ b/client/src/utils/router.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { Router, Route, Switch } from "react-router-dom"; -import * as creacteHistory from "history"; +import { Route, Switch } from "react-router-dom"; + import { HomeController } from "../controllers/HomeController"; import { ProjectController } from "../controllers/ProjectController"; import { UserController } from "../controllers/UserController";