Skip to content

Commit

Permalink
add : 출석체크시 이동교실 표시
Browse files Browse the repository at this point in the history
add : 출석체크시 이동교실 표시
  • Loading branch information
phyuna0525 authored May 10, 2024
2 parents dc5682d + fbc01fc commit 9e02604
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/classChange/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import apiError from "@/hook/errorHandling";

export const AcceptClassChange = (floor: number) => {
return useQuery<FloorClass[]>({
queryKey: ["AcceptClassChange", floor], // floor를 queryKey에 추가
queryKey: ["AcceptClassChange", floor],
queryFn: async () => {
const response = await instance.get(
`/class-room/floor?floor=${floor}&status=QUIET`
Expand Down
1 change: 1 addition & 0 deletions src/api/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface ClubList {
grade: number;
class_num: number;
num: number;
classroom_name: string;
status6: string;
status7: string;
status8: string;
Expand Down
1 change: 1 addition & 0 deletions src/app/attendanceCheck/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const attendanceCheck = () => {
state4={item.status9}
state5={item.status10}
after
class_name={item.classroom_name}
/>
))}
</div>
Expand Down
13 changes: 12 additions & 1 deletion src/components/list/afterManage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface NonReturnProp {
after?: boolean;
name: string;
time?: number;
class_name?: string;
}

export const AfterList = ({
Expand All @@ -25,6 +26,7 @@ export const AfterList = ({
id,
onClick,
name,
class_name,
}: NonReturnProp) => {
const Change = (item: string) => {
switch (item) {
Expand Down Expand Up @@ -106,7 +108,16 @@ export const AfterList = ({
className={`min-w-fit gap-2 flex justify-between w-full bg-white px-4 py-3 rounded-lg flex-col`}
>
<div className=" whitespace-nowrap min-w-fit gap-2 items-center flex justify-between w-full rounded-lg">
<div className=" text-sub-title4-M">{name}</div>
<div className=" flex whitespace-nowrap gap-2 items-center justify-between">
<div className=" text-sub-title4-M">{name}</div>
{class_name === "" ? (
""
) : (
<div className=" border border-primary-400 px-2 py-1 rounded-2xl bg-primary-400 text-body3 text-white">
{class_name}
</div>
)}
</div>
<StatusDrop onChange={ClassCheck} state={Change(changeProp())} />
</div>
</div>
Expand Down

0 comments on commit 9e02604

Please sign in to comment.