Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hyuna committed May 1, 2024
2 parents 2e18641 + a830dc6 commit aba8810
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stagGitAction.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: stagDeploy

on:
push:
Expand Down
2 changes: 2 additions & 0 deletions src/api/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export interface AfterStudent {
status1: string;
status2: string;
status3: string;
status4: string;
status5: string;
}

export interface ChangeClub {
Expand Down
21 changes: 20 additions & 1 deletion src/app/afterManage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ const AfterManage = () => {
const parsedData = JSON.parse(localData);
const studentData = {
user_id: item.id,
status_list: [parsedData[0], parsedData[1], parsedData[2]],
status_list: [
parsedData[0],
parsedData[1],
parsedData[2],
parsedData[3],
parsedData[4],
],
};
updatedData.push(studentData);
}
Expand Down Expand Up @@ -139,6 +145,15 @@ const AfterManage = () => {
}
}, [getClub]);

useEffect(() => {
const keys = Object.keys(localStorage);
keys.forEach((key) => {
if (key.includes("-")) {
localStorage.removeItem(key);
}
});
}, [selectClub]);

const handleClubChange = (selectedOption: string) => {
setSelectClub(selectedOption);
};
Expand Down Expand Up @@ -203,6 +218,8 @@ const AfterManage = () => {
state1={item.status6}
state2={item.status7}
state3={item.status8}
state4={item.status9}
state5={item.status10}
/>
))
) : (
Expand All @@ -220,6 +237,8 @@ const AfterManage = () => {
state1={item.status1}
state2={item.status2}
state3={item.status3}
state4={item.status4}
state5={item.status5}
name={`${setStudentNum(item)} ${item.name}`}
onClick={() =>
handleAcceptListClick(item.id, item.name)
Expand Down
10 changes: 9 additions & 1 deletion src/app/attendanceCheck/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ const attendanceCheck = () => {
const parsedData = JSON.parse(localData);
const studentData = {
user_id: item.id,
status_list: [parsedData[0], parsedData[1], parsedData[2]],
status_list: [
parsedData[0],
parsedData[1],
parsedData[2],
parsedData[3],
parsedData[4],
],
};
updatedData.push(studentData);
}
Expand Down Expand Up @@ -123,6 +129,8 @@ const attendanceCheck = () => {
state1={item.status6}
state2={item.status7}
state3={item.status8}
state4={item.status9}
state5={item.status10}
after
/>
))}
Expand Down
9 changes: 7 additions & 2 deletions src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import Image from "next/image";
import Input from "@/components/input";
import Button from "@/components/button";
import Logo from "@/assets/svg/PiCKLogo.svg";
import { useState } from "react";
import { useEffect, useState } from "react";
import { useLogin } from "@/api/login";
import { useRouter } from "next/navigation";
import { saveToken } from "@/util/auth";
import { cookie, saveToken } from "@/util/auth";

interface ChangeProps {
text: string;
Expand Down Expand Up @@ -59,6 +59,11 @@ const Login = () => {
router.push("/login");
}
};

useEffect(() => {
cookie.remove("access_token");
cookie.remove("refresh_token");
}, []);

const BtnColor = () => {
if (data.admin_id === "" || data.password === "") {
Expand Down
10 changes: 5 additions & 5 deletions src/app/outAccept/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ const OutAccept = () => {
} else setAcModal(true);
};

const onCancel = () => {
setAcModal(false);
setNomodal(false);
};

const No = () => {
if (selectedStudents.length === 0) {
alert("외출 거절 할 학생을 선택해주세요");
} else setNomodal(true);
};

const onCancel = () => {
setAcModal(false);
setNomodal(false);
};

const onClickTab = (tab: boolean) => {
setSelectedTab(tab);
};
Expand Down
98 changes: 34 additions & 64 deletions src/components/list/afterManage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ interface NonReturnProp {
state1: string;
state2: string;
state3: string;
state4?: string;
state5?: string;
state4: string;
state5: string;
id: string;
onClick?: () => void;
after?: boolean;
Expand All @@ -24,7 +24,6 @@ export const AfterList = ({
time,
id,
onClick,
after,
name,
}: NonReturnProp) => {
const Change = (item: string) => {
Expand All @@ -49,7 +48,7 @@ export const AfterList = ({
const [statusList, setStatusList] = useState<string[]>([]);

useEffect(() => {
setStatusList([state1, state2, state3]);
setStatusList([state1, state2, state3, state4, state5]);
}, [state1, state2, state3]);

useEffect(() => {
Expand All @@ -63,70 +62,41 @@ export const AfterList = ({
};

const ClassCheck = (newState: string) => {
if (after) {
switch (time) {
case 8:
handleChange(0, newState);
break;
case 9:
handleChange(1, newState);
break;
case 10:
handleChange(2, newState);
break;
default:
break;
}
} else {
switch (time) {
case 6:
handleChange(0, newState);
break;
case 7:
handleChange(1, newState);
break;
case 8:
handleChange(2, newState);
break;
case 9:
handleChange(3, newState);
break;
case 10:
handleChange(4, newState);
break;
default:
break;
}
switch (time) {
case 6:
handleChange(0, newState);
break;
case 7:
handleChange(1, newState);
break;
case 8:
handleChange(2, newState);
break;
case 9:
handleChange(3, newState);
break;
case 10:
handleChange(4, newState);
break;
default:
break;
}
};

const changeProp = () => {
if (after) {
switch (time) {
case 8:
return state1;
case 9:
return state2;
case 10:
return state3;
default:
return "";
}
} else {
switch (time) {
case 6:
return state1;
case 7:
return state2;
case 8:
return state3;
case 9:
return state4 || "";
case 10:
return state5 || "";
default:
return "";
}
switch (time) {
case 6:
return state1;
case 7:
return state2;
case 8:
return state3;
case 9:
return state4 || "";
case 10:
return state5 || "";
default:
return "";
}
};

Expand Down

0 comments on commit aba8810

Please sign in to comment.