-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/DSM-PICK/PICK2024_FRONT_…
…TEACHER into develop
- Loading branch information
Showing
16 changed files
with
595 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useMutation, useQuery } from "@tanstack/react-query"; | ||
import { instance } from ".."; | ||
import { applicationOK, earlyReturnHome } from "../type"; | ||
|
||
export const Application = () => { | ||
return useQuery<applicationOK[]>({ | ||
queryKey: ["outList"], | ||
queryFn: async () => { | ||
const response = await instance.get(`application/non-return`); | ||
return response.data; | ||
}, | ||
}); | ||
}; | ||
|
||
export const EarlyReturn = () => { | ||
return useQuery<earlyReturnHome[]>({ | ||
queryKey: ["earlyReturn"], | ||
queryFn: async () => { | ||
const response = await instance.get(`early-return/ok`); | ||
return response.data; | ||
}, | ||
}); | ||
}; | ||
|
||
export const ReturnSchool = () => { | ||
return useMutation<Error, void, { id: string }>({ | ||
mutationFn: async (param) => { | ||
try { | ||
const response = await instance.patch( | ||
`/application/change/${param.id}` | ||
); | ||
return response.data; | ||
} catch (error) { | ||
throw error; | ||
} | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export interface applicationOK { | ||
id: string; | ||
username: string; | ||
start_time: string; | ||
end_time: string; | ||
grade: number; | ||
class_num: number; | ||
num: number; | ||
} | ||
|
||
export interface earlyReturnHome { | ||
id: string; | ||
username: string; | ||
start_time: string; | ||
grade: number; | ||
class_num: number; | ||
num: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"use client"; | ||
import Header from "@/components/header"; | ||
import Tab from "@/components/tab"; | ||
import React from "react"; | ||
|
||
interface Prop { | ||
title: string; | ||
subTitle: string; | ||
Dropdown?: React.ReactNode; | ||
TabOK: boolean; | ||
children: React.ReactNode; | ||
TabOnclick: (tab: boolean) => void; | ||
} | ||
|
||
const BackGround: React.FC<Prop> = ({ | ||
title, | ||
subTitle, | ||
Dropdown, | ||
TabOK = true, | ||
children, | ||
TabOnclick, | ||
}) => { | ||
return ( | ||
<div className=" min-w-fit min-h-full h-dvh px-6 py-3 bg-primary-1200"> | ||
<Header /> | ||
<div> | ||
<div className=" py-3 flex items-center gap-3 font-sans"> | ||
<div className=" text-sub-title1-M">{title}</div> | ||
<div className=" text-sun-title3-M text-neutral-300">{subTitle}</div> | ||
</div> | ||
<div>{Dropdown}</div> | ||
<div className=" flex flex-col gap-6"> | ||
<div> | ||
{TabOK && ( | ||
<Tab | ||
firstText="외출" | ||
SecondText="조기귀가" | ||
onClick={TabOnclick} | ||
/> | ||
)} | ||
</div> | ||
{children} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BackGround; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.