organize project page components
This commit is contained in:
@@ -10,8 +10,8 @@ import {
|
||||
import { useState } from "react";
|
||||
import { SubmitHandler, useForm } from "react-hook-form";
|
||||
import { KeyedMutator } from "swr";
|
||||
import { useAuth } from "../../../hooks/useAuth";
|
||||
import { APIProjectList } from "../Projects";
|
||||
import { useAuth } from "../../../../hooks/useAuth";
|
||||
import { APIProjectList } from "../../Projects";
|
||||
|
||||
type NewProjectForm = {
|
||||
name: string;
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./NewProjectAction";
|
||||
@@ -2,8 +2,8 @@ import AddTaskIcon from "@mui/icons-material/AddTask";
|
||||
import { Box, Button, TextField, Toolbar } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import { SubmitHandler, useForm } from "react-hook-form";
|
||||
import { useAuth } from "../../../hooks/useAuth";
|
||||
import { useProject } from "../../../hooks/useProject";
|
||||
import { useAuth } from "../../../../hooks/useAuth";
|
||||
import { useProject } from "../../../../hooks/useProject";
|
||||
|
||||
type NewTaskForm = {
|
||||
description: string;
|
||||
@@ -12,8 +12,8 @@ type NewTaskForm = {
|
||||
export const AddTask = () => {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const { apiClient } = useAuth();
|
||||
const { register, handleSubmit, reset } = useForm<NewTaskForm>();
|
||||
const { tasksMutate, project } = useProject();
|
||||
const { register, handleSubmit, reset } = useForm<NewTaskForm>();
|
||||
|
||||
const onSubmit: SubmitHandler<NewTaskForm> = (data) => {
|
||||
setIsLoading(true);
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
DialogTitle
|
||||
} from "@mui/material";
|
||||
import { SetStateAction, useState } from "react";
|
||||
import { useAuth } from "../../../hooks/useAuth";
|
||||
import { useProject } from "../../../hooks/useProject";
|
||||
import { useAuth } from "../../../../hooks/useAuth";
|
||||
import { useProject } from "../../../../hooks/useProject";
|
||||
|
||||
export type DeleteProjectDialogProps = {
|
||||
open: boolean;
|
||||
@@ -1,15 +1,11 @@
|
||||
import { Add } from "@mui/icons-material";
|
||||
import {
|
||||
Card,
|
||||
CardActions,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
IconButton,
|
||||
Card, CardContent,
|
||||
CardHeader
|
||||
} from "@mui/material";
|
||||
import useSWR from "swr";
|
||||
import { useAuth } from "../../../hooks/useAuth";
|
||||
import { ProjectProvider } from "../../../providers/ProjectProvider";
|
||||
import { createSWRFetcher } from "../../../utils/swrFetcher";
|
||||
import { useAuth } from "../../../../hooks/useAuth";
|
||||
import { ProjectProvider } from "../../../../providers/ProjectProvider";
|
||||
import { createSWRFetcher } from "../../../../utils/swrFetcher";
|
||||
import { AddTask } from "./AddTask";
|
||||
import { ProjectOptions } from "./ProjectOptions";
|
||||
import { TaskListProps, TasksList } from "./TasksList";
|
||||
@@ -49,11 +45,6 @@ export const Project = (props: ProjectProps) => {
|
||||
<TasksList title="To Do" tasks={uncompletedTasks} />
|
||||
<TasksList title="Done" tasks={completedTasks} />
|
||||
</CardContent>
|
||||
<CardActions disableSpacing>
|
||||
<IconButton aria-label="add task">
|
||||
<Add />
|
||||
</IconButton>
|
||||
</CardActions>
|
||||
</Card>
|
||||
</ProjectProvider>
|
||||
);
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
} from "@mui/material";
|
||||
import { SetStateAction, useState } from "react";
|
||||
import { SubmitHandler, useForm } from "react-hook-form";
|
||||
import { useAuth } from "../../../hooks/useAuth";
|
||||
import { useProject } from "../../../hooks/useProject";
|
||||
import { useAuth } from "../../../../hooks/useAuth";
|
||||
import { useProject } from "../../../../hooks/useProject";
|
||||
|
||||
type RenameProjectForm = {
|
||||
name: string;
|
||||
@@ -1,6 +1,6 @@
|
||||
import { List, ListSubheader } from "@mui/material";
|
||||
import { useAuth } from "../../../hooks/useAuth";
|
||||
import { useProject } from "../../../hooks/useProject";
|
||||
import { useAuth } from "../../../../hooks/useAuth";
|
||||
import { useProject } from "../../../../hooks/useProject";
|
||||
import { Task, TasksListItem } from "./TasksListItem";
|
||||
|
||||
export type TaskListProps = {
|
||||
1
client/src/pages/Projects/components/Project/index.ts
Normal file
1
client/src/pages/Projects/components/Project/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './Project'
|
||||
Reference in New Issue
Block a user