diff --git a/src/api/afterManage/index.ts b/src/api/afterManage/index.ts index 12f327b..c27cfbc 100644 --- a/src/api/afterManage/index.ts +++ b/src/api/afterManage/index.ts @@ -1,6 +1,6 @@ import { useMutation, useQuery } from "@tanstack/react-query"; import { instance } from ".."; -import { ChangeStatus, ClubList } from "../type"; +import { ChangeStatus, ClubList, Type } from "../type"; export const GetClubList = (club: string) => { return useQuery({ @@ -23,3 +23,13 @@ export const FixStatus = () => { }, }); }; + +export const AllStudent = () => { + return useQuery({ + queryKey: ["AllStudent"], + queryFn: async () => { + const response = await instance.get(`/after/search`); + return response.data; + }, + }); +}; diff --git a/src/api/type.ts b/src/api/type.ts index fba08c0..42c6510 100644 --- a/src/api/type.ts +++ b/src/api/type.ts @@ -66,3 +66,10 @@ export interface CountOutListType { request: number; classMove: number; } + +export interface Type { + grade: number; + class_num: number; + num: number; + name: string; +} diff --git a/src/app/afterManage/page.tsx b/src/app/afterManage/page.tsx index ba8c29c..f1e4cba 100644 --- a/src/app/afterManage/page.tsx +++ b/src/app/afterManage/page.tsx @@ -5,6 +5,7 @@ import BackGround from "@/components/background"; import Button from "@/components/button"; import Dropdown from "@/components/dropdown"; import AfterList from "@/components/list/afterManage"; +import Modal from "@/components/modal"; import { getStudentString } from "@/util/util"; import { useEffect, useState } from "react"; @@ -13,6 +14,7 @@ const AfterManage = () => { const [selectedTab, setSelectedTab] = useState(true); const [selectClassTime, setSelectClassTime] = useState(8); const [selectClub, setSelectClub] = useState("대동여지도"); + const [modal, setMadal] = useState(false); const { data: getClub } = GetClubList(selectClub); const { mutate: changeStatus } = FixStatus(); @@ -56,6 +58,10 @@ const AfterManage = () => { setSelectedTab(tab); }; + const onAdd = () => { + setMadal(true); + }; + return ( { leftTab="전공 동아리" rightTab="방과후(창조실)" Dropdown={ -
- - -
+ <> + {selectedTab ? ( +
+ + +
+ ) : ( +
+ + +
+ )} + } TabOnclick={onClickTab} >
- {selectedTab && + {selectedTab ? ( clubList.map((item, index) => ( { state2={item.status7} state3={item.status8} /> - ))} + )) + ) : ( +
+ )} + {modal && ( + {}} + onConfirm={() => {}} + /> + )}