mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 11:46:40 +00:00
[UI] updated ProjectList
This commit is contained in:
parent
cef6fcb543
commit
9e7a1290c0
1 changed files with 28 additions and 8 deletions
|
|
@ -1,12 +1,26 @@
|
||||||
import React, { FC, useState, ChangeEvent, MouseEvent } from "react";
|
import React, { FC, useState, ChangeEvent, MouseEvent } from "react";
|
||||||
import { Ticket } from "../types/Ticket";
|
import {
|
||||||
|
Typography,
|
||||||
|
Grid,
|
||||||
|
makeStyles,
|
||||||
|
createStyles,
|
||||||
|
Theme,
|
||||||
|
} from "@material-ui/core";
|
||||||
import { HorizontalCard } from "./HorizontalCard";
|
import { HorizontalCard } from "./HorizontalCard";
|
||||||
import { FilterBar } from "./FilterBar";
|
import { FilterBar } from "./FilterBar";
|
||||||
import { put } from "../utils/http";
|
import { Ticket } from "../types/Ticket";
|
||||||
import { Constants } from "../utils/Constants";
|
|
||||||
import { HttpResponse } from "../types/HttpResponse";
|
import { HttpResponse } from "../types/HttpResponse";
|
||||||
import { Project } from "../types/Project";
|
import { Project } from "../types/Project";
|
||||||
import { Typography, Grid } from "@material-ui/core";
|
import { put } from "../utils/http";
|
||||||
|
import { Constants } from "../utils/Constants";
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
header: {
|
||||||
|
paddingBottom: theme.spacing(2),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
projects: Project[];
|
projects: Project[];
|
||||||
|
|
@ -23,19 +37,25 @@ export const ProjectList: FC<IProps> = ({ projects }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
let filteredTickets = projects.filter(
|
let filteredTickets = projects.filter(
|
||||||
t =>
|
(t) =>
|
||||||
t.status !== "Done" &&
|
t.status !== "Done" &&
|
||||||
t.title.toLowerCase().includes(filterText.toLowerCase())
|
t.title.toLowerCase().includes(filterText.toLowerCase())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const classes = useStyles();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid item xs>
|
<Grid
|
||||||
|
container
|
||||||
|
direction="row"
|
||||||
|
justify="space-between"
|
||||||
|
alignItems="center"
|
||||||
|
className={classes.header}
|
||||||
|
>
|
||||||
<Typography variant="h4" component="h4">
|
<Typography variant="h4" component="h4">
|
||||||
Projects
|
Projects
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
|
||||||
<Grid item xs={4}>
|
|
||||||
<FilterBar
|
<FilterBar
|
||||||
filterText={filterText}
|
filterText={filterText}
|
||||||
handleChange={handleChange}
|
handleChange={handleChange}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue