Skip to content

Commit 1353c46

Browse files
authored
Release (#480)
* [ comment ] ์•ˆ ์“ฐ๋Š” ํŽ˜์ด์ง€ ์šฐ์„  ์ฃผ์„ * [ fix ] ์ฟผ๋ฆฌ ์ˆ˜์ • * [ fix ] ์—๋Ÿฌ๋ฉ”์‹œ์ง€๋ฅผ ๋ชจ๋‹ฌ ๋ฉ”์‹œ์ง€๋กœ * [ fix ] ์˜คํƒ€ ์ˆ˜์ •๊ณผ key ์—๋Ÿฌ ์ˆ˜์ • * [ design ] ๋ชจ๋‹ฌ ๋ฐฐ๊ฒฝ ๊ฝ‰ ์ฐจ๊ฒŒ
1 parent 530e5c2 commit 1353c46

File tree

12 files changed

+133
-114
lines changed

12 files changed

+133
-114
lines changed

โ€Žsrc/Router.tsxโ€Ž

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Suspense } from "react";
66
import { removeCookie } from "./api/cookie";
77
import ConnectParentsAndTeacher from "./components/RegularLesson/ConnectParentsAndTeacher";
88
import AfterSignup from "./components/welcomeSignup/AfterSignup";
9-
import AllowAlert from "./components/welcomeSignup/AllowAlert";
109
import ChangeSchedule from "./pages/ChangeSchedule";
1110
import CompleteCheckAttendance from "./pages/CompleteCheckAttendance";
1211
import EditSchedule from "./pages/EditSchedule";
@@ -39,70 +38,69 @@ import TimePickerPage from "./pages/TimePickerPage";
3938
import TuitionPayment from "./pages/TuitionPayment";
4039
import WelcomeSignup from "./pages/WelcomeSignup";
4140
import PrivateRoute from "./utils/common/privateRoute";
42-
interface fallbackProps {
43-
error: Error;
44-
resetError: () => void;
45-
}
41+
interface fallbackProps {
42+
error: Error;
43+
resetError: () => void;
44+
}
4645

4746
export default function Router() {
48-
4947
return (
5048
<BrowserRouter>
5149
<Sentry.ErrorBoundary fallback={fallbackRender}>
5250
{/* <ErrorBoundary FallbackComponent={fallbackRender}> */}
53-
<Suspense fallback={<Loading />}>
54-
<Routes>
55-
<Route path="/" element={<OnBoarding />} />
56-
<Route path="/landing" element={<Landing />} />
57-
<Route path="/on-boarding" element={<OnBoarding />} />
58-
<Route path="/welcome" element={<WelcomeSignup />} />
59-
<Route path="/:lessonId" element={<ConnectParentsAndTeacher />} />
60-
<Route path="/signup" element={<Signup />} />
61-
<Route path="/login" element={<Login />} />
62-
<Route path="/lesson-share" element={<LessonShare />} />
63-
<Route path="/kakao-redirect" element={<KakaoRedirect />} />
64-
<Route path="/naver-redirect" element={<NaverRedirect />} />
51+
<Suspense fallback={<Loading />}>
52+
<Routes>
53+
<Route path="/" element={<OnBoarding />} />
54+
<Route path="/landing" element={<Landing />} />
55+
<Route path="/on-boarding" element={<OnBoarding />} />
56+
<Route path="/welcome" element={<WelcomeSignup />} />
57+
<Route path="/:lessonId" element={<ConnectParentsAndTeacher />} />
58+
<Route path="/signup" element={<Signup />} />
59+
<Route path="/login" element={<Login />} />
60+
<Route path="/lesson-share" element={<LessonShare />} />
61+
<Route path="/kakao-redirect" element={<KakaoRedirect />} />
62+
<Route path="/naver-redirect" element={<NaverRedirect />} />
6563

66-
<Route element={<PrivateRoute authentication={true} />}>
67-
<Route path="/home" element={<Home />} />
68-
<Route path="/complete-check-attendance" element={<CompleteCheckAttendance />} />
69-
<Route path="/manage-lesson" element={<ManageLessonMain />} />
70-
<Route path="/manage-lesson/:manageLessonId" element={<ManageLessonDetail />} />
71-
<Route path="/register-payment/:manageLessonId" element={<RegisterPayment />} />
72-
<Route path="/parent-calendar" element={<ParentCalendar />} />
73-
<Route path="/register-lesson" element={<RegisterLesson />} />
74-
<Route path="/regular-lesson-cycle" element={<RegularLessonCycle />} />
75-
<Route path="/regular-lesson-date" element={<RegularLessonDate />} />
76-
<Route path="/regular-lesson" element={<RegularLesson />} />
77-
<Route path="/register-calendar" element={<RegisterCalendar />} />
78-
<Route path="/lesson-detail/:lessonId" element={<LessonDetail />} />
79-
<Route path="/time-picker" element={<TimePickerPage />} />
80-
<Route path="/schedule" element={<ChangeSchedule />} />
81-
<Route path="/tuition-payment" element={<TuitionPayment />} />
82-
<Route path="/register-complete" element={<LessonRegisterComplete />} />
83-
<Route path="/lesson-connect" element={<LessonConnect />} />
64+
<Route element={<PrivateRoute authentication={true} />}>
65+
<Route path="/home" element={<Home />} />
66+
<Route path="/complete-check-attendance" element={<CompleteCheckAttendance />} />
67+
<Route path="/manage-lesson" element={<ManageLessonMain />} />
68+
<Route path="/manage-lesson/:manageLessonId" element={<ManageLessonDetail />} />
69+
<Route path="/register-payment/:manageLessonId" element={<RegisterPayment />} />
70+
<Route path="/parent-calendar" element={<ParentCalendar />} />
71+
<Route path="/register-lesson" element={<RegisterLesson />} />
72+
<Route path="/regular-lesson-cycle" element={<RegularLessonCycle />} />
73+
<Route path="/regular-lesson-date" element={<RegularLessonDate />} />
74+
<Route path="/regular-lesson" element={<RegularLesson />} />
75+
<Route path="/register-calendar" element={<RegisterCalendar />} />
76+
<Route path="/lesson-detail/:lessonId" element={<LessonDetail />} />
77+
<Route path="/time-picker" element={<TimePickerPage />} />
78+
<Route path="/schedule" element={<ChangeSchedule />} />
79+
<Route path="/tuition-payment" element={<TuitionPayment />} />
80+
<Route path="/register-complete" element={<LessonRegisterComplete />} />
81+
<Route path="/lesson-connect" element={<LessonConnect />} />
8482

85-
<Route path="/myPage" element={<MyPage />} />
86-
<Route path="/no-attendance-check" element={<NoAttendanceCheck />} />
87-
<Route path="/lesson-info/:lessonId" element={<LessonInfo />} />
88-
<Route path="/edit-lessonschedule" element={<EditSchedule />} />
89-
<Route path="/alert" element={<AllowAlert />} />
90-
<Route path="/tree" element={<AfterSignup />} />
91-
</Route>
92-
</Routes>
93-
</Suspense>
83+
<Route path="/myPage" element={<MyPage />} />
84+
<Route path="/no-attendance-check" element={<NoAttendanceCheck />} />
85+
<Route path="/lesson-info/:lessonId" element={<LessonInfo />} />
86+
<Route path="/edit-lessonschedule" element={<EditSchedule />} />
87+
{/* <Route path="/alert" element={<AllowAlert />} /> */}
88+
<Route path="/tree" element={<AfterSignup />} />
89+
</Route>
90+
</Routes>
91+
</Suspense>
9492
{/* </ErrorBoundary> */}
9593
</Sentry.ErrorBoundary>
9694
</BrowserRouter>
9795
);
9896
}
9997

100-
function fallbackRender({ error, resetError }:fallbackProps) {
101-
if ( error instanceof AxiosError && error.response?.status === 401) {
102-
resetError();
103-
removeCookie("accessToken");
104-
return <Navigate to="/" />;
98+
function fallbackRender({ error, resetError }: fallbackProps) {
99+
if (error instanceof AxiosError && error.response?.status === 401) {
100+
resetError();
101+
removeCookie("accessToken");
102+
return <Navigate to="/" />;
105103
} else {
106-
return <ErrorPage resetErrorBoundary={resetError} />;
104+
return <ErrorPage resetErrorBoundary={resetError} />;
107105
}
108106
}

โ€Žsrc/components/Calendar/Change/ChangeModal.tsxโ€Ž

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ import styled from "styled-components";
66
import { deleteSchedule } from "../../../api/calendar/deleteSchedule";
77
import { removeTrashCan } from "../../../assets";
88
import { STUDENT_COLOR } from "../../../core/common/studentColor";
9+
import { TEACHER_FOOTER_CATEGORY } from "../../../core/teacherHome/teacherFooter";
910
import useGetScheduleByUser from "../../../hooks/useGetScheduleByUser";
1011
import useModal from "../../../hooks/useModal";
12+
import useTeacherFooter from "../../../hooks/useTeacherFooter";
1113
import { modalType } from "../../../type/calendar/modalType";
1214
import { BasicDoubleModal } from "../../common";
1315
import StudentColorBox from "../../common/StudentColorBox";
1416
import ToastModal from "../../common/ToastModal";
17+
import ParentsDisabledAlarmModal from "../../modal/ParentsDisabledAlarmModal";
1518
import EditScheduleButton from "./EditScheduleButton";
1619

1720
export default function ChangeModal(props: modalType) {
1821
const { selectedDate, setOpenModal, formattedMonth } = props;
22+
const [isDisabledModalOpen, setIsDisabledModalOpen] = useState(false);
1923
const WEEKDAY: string[] = ["์ผ", "์›”", "ํ™”", "์ˆ˜", "๋ชฉ", "๊ธˆ", "ํ† "]; //TODO ์ด๊ฑฐ ํ•จ์ˆ˜๋กœ ๋นผ๊ธฐ
24+
const [errorMessage, setErrorMessage] = useState<string>("");
2025
const { isUserSchedule } = useGetScheduleByUser(formattedMonth);
26+
const { handleMoveToPage } = useTeacherFooter();
2127
const queryClient = useQueryClient();
2228
const { unShowModal } = useModal();
2329

@@ -41,8 +47,12 @@ export default function ChangeModal(props: modalType) {
4147
setModalOn(false);
4248
unShowModal();
4349
},
44-
onError: () => {
45-
alert("์ผ์ • ์‚ญ์ œ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.");
50+
51+
onError: (error: any) => {
52+
setIsDisabledModalOpen(true);
53+
if (error?.response?.data?.message) {
54+
setErrorMessage(error?.response?.data?.message);
55+
}
4656
},
4757
});
4858

@@ -55,8 +65,19 @@ export default function ChangeModal(props: modalType) {
5565
setIsEdit(true);
5666
}
5767

68+
function handleCloseModal() {
69+
setIsDisabledModalOpen(false);
70+
unShowModal();
71+
handleMoveToPage(TEACHER_FOOTER_CATEGORY.home);
72+
}
73+
5874
return (
5975
<>
76+
{isDisabledModalOpen && (
77+
<ParentsDisabledAlarmModalWrapper>
78+
<ParentsDisabledAlarmModal handleCloseModal={handleCloseModal} errMsg={errorMessage} />
79+
</ParentsDisabledAlarmModalWrapper>
80+
)}
6081
{modalOn && (
6182
<ConfirmModalWrapper>
6283
<BasicDoubleModal
@@ -65,7 +86,7 @@ export default function ChangeModal(props: modalType) {
6586
handleClickLeftButton={() => setModalOn(false)}
6687
handleClickRightButton={() => deleteScheduleStatus()}>
6788
<ContentWrapper>
68-
{modalContents.year}๋…„ {modalContents.month}์›” {modalContents.day}์ผ {modalContents.dayOfWeekKor}์š”์ผ{" "}
89+
{modalContents.year}๋…„ {modalContents.month}์›” {modalContents.day}์ผ {modalContents.dayOfWeekKor}์š”์ผ
6990
<br />
7091
{modalContents.startTime} - {modalContents.endTime} <br /> {modalContents.studentName}(
7192
{modalContents.subject}
@@ -229,3 +250,8 @@ const ConfirmModalWrapper = styled.div`
229250
height: 100%;
230251
position: absolute;
231252
`;
253+
254+
const ParentsDisabledAlarmModalWrapper = styled.div`
255+
position: fixed;
256+
z-index: 7;
257+
`;

โ€Žsrc/components/common/AttendanceDoubleCheckingModal.tsxโ€Ž

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from "react";
22
import { useMutation } from "react-query";
33
import { useNavigate } from "react-router-dom";
4-
import { useRecoilState } from "recoil";
4+
import { useRecoilValue } from "recoil";
55
import styled from "styled-components";
66
import { updateScheduleAttendance } from "../../api/updateScheduleAttendance";
77
import { attendanceStatus } from "../../atom/attendanceCheck/attendanceStatus";
@@ -16,7 +16,7 @@ interface AttendanceDoubleCheckingModalProps {
1616
export default function AttendanceDoubleCheckingModal(props: AttendanceDoubleCheckingModalProps) {
1717
const { setIsCheckingModalOpen } = props;
1818
const navigate = useNavigate();
19-
const [attendanceData, setAttendanceData] = useRecoilState(attendanceStatus);
19+
const attendanceData = useRecoilValue(attendanceStatus);
2020
const [isImpossibleModalOpen, setIsImpossibleModalOpen] = useState(false);
2121

2222
function handleBackToCheckAttendance() {
@@ -28,9 +28,7 @@ export default function AttendanceDoubleCheckingModal(props: AttendanceDoubleChe
2828
navigate("/complete-check-attendance", { state: ATTENDANCE_CHECK_RESPONSE });
2929
},
3030
onError: () => {
31-
// if (err?.response?.data?.message) {
3231
setIsImpossibleModalOpen(true);
33-
// }
3432
},
3533
});
3634

โ€Žsrc/components/common/BasicDoubleModal.tsxโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ const ModalWrapper = styled.div<{ $position: string | undefined }>`
5252
flex-direction: column;
5353
z-index: 3;
5454
55-
width: 32rem;
56-
height: 100vh;
55+
width: 33rem;
56+
height: 109vh;
5757
margin-top: -4rem;
5858
5959
background-color: rgb(33 37 41 / 60%);

โ€Žsrc/components/common/SendAlarmCheckModal.tsxโ€Ž

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { useState } from "react";
22
import { useQuery, useQueryClient } from "react-query";
33
import { useNavigate } from "react-router-dom";
4-
import { useRecoilState } from "recoil";
4+
import { useRecoilState, useSetRecoilState } from "recoil";
55
import { styled } from "styled-components";
6+
import { SubjectLabel } from ".";
67
import { requestAttendanceNotification } from "../../api/requestAttendanceNotification";
78
import { attendanceStatus } from "../../atom/attendanceCheck/attendanceStatus";
89
import { agreeSend } from "../../atom/common/agreeSend";
@@ -13,7 +14,6 @@ import useModal from "../../hooks/useModal";
1314
import useTeacherFooter from "../../hooks/useTeacherFooter";
1415
import ParentsDisabledAlarmModal from "../modal/ParentsDisabledAlarmModal";
1516
import RoundBottomMiniButton from "./RoundBottomMiniButton";
16-
import SubjectLabel from "./SubjectLabel";
1717
import ToastModal from "./ToastModal";
1818

1919
interface SendAlarmCheckModalProps {
@@ -26,18 +26,17 @@ interface SendAlarmCheckModalProps {
2626

2727
export default function SendAlarmCheckModal(props: SendAlarmCheckModalProps) {
2828
const { idx, studentName, subject, count, scheduleIdx } = props;
29-
const [isClassExist, setIsClassExist] = useState(true);
30-
const { modalRef, closeModal, unShowModal, showModal } = useModal();
29+
const { unShowModal } = useModal();
3130
const navigate = useNavigate();
3231
const [isDisabledModalOpen, setIsDisabledModalOpen] = useState(false);
32+
const [errMsg, setErrMsg] = useState<string>();
3333
const { handleMoveToPage } = useTeacherFooter();
3434
const [isAgreeSend, setIsAgreeSend] = useRecoilState<undefined | string>(agreeSend);
35-
const [snackBarOpen, setSanckBarOpen] = useRecoilState(isSnackBarOpen);
36-
const [attendanceData, setAttendanceData] = useRecoilState(attendanceStatus);
35+
const setSnackBarOpen = useSetRecoilState(isSnackBarOpen);
36+
const setAttendanceData = useSetRecoilState(attendanceStatus);
3737

3838
function handleMoveToHomeWithoutAlarm() {
3939
unShowModal();
40-
// handleMoveToPage(TEACHER_FOOTER_CATEGORY.home);
4140
navigate(-1);
4241
}
4342

@@ -50,15 +49,17 @@ export default function SendAlarmCheckModal(props: SendAlarmCheckModalProps) {
5049
onSuccess: (res) => {
5150
if (res.data.message === "ํ•™๋ถ€๋ชจ์—๊ฒŒ ์ถœ๊ฒฐ์•Œ๋žŒ ๋ณด๋‚ด๊ธฐ ์„ฑ๊ณต") {
5251
handleMoveToHomeWithoutAlarm();
53-
// setIsAgreeSend(undefined);
54-
setSanckBarOpen(true);
52+
setSnackBarOpen(true);
5553
setAttendanceData({ idx: 0, status: "" });
54+
console.log(sendAlarm);
5655
}
5756
},
5857
onError: (error: any) => {
59-
if (error?.response?.data?.message === "๋ ˆ์Šจ์— ํ•™๋ถ€๋ชจ๊ฐ€ ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.") {
60-
setIsDisabledModalOpen(true);
58+
console.log(error);
59+
if (error?.response?.data?.message) {
60+
setErrMsg(error?.response?.data?.message);
6161
}
62+
setIsDisabledModalOpen(true);
6263
},
6364
enabled: !!isAgreeSend,
6465
suspense: false,
@@ -68,7 +69,7 @@ export default function SendAlarmCheckModal(props: SendAlarmCheckModalProps) {
6869

6970
function handleSendAlarm() {
7071
setIsAgreeSend("true");
71-
queryClient.invalidateQueries("requestAttendanceNotification");
72+
queryClient.invalidateQueries(["requestAttendanceNotification"]);
7273
}
7374

7475
function handleCloseModal() {
@@ -81,7 +82,7 @@ export default function SendAlarmCheckModal(props: SendAlarmCheckModalProps) {
8182
<>
8283
{isDisabledModalOpen && (
8384
<ParentsDisabledAlarmModalWrapper>
84-
<ParentsDisabledAlarmModal handleCloseModal={handleCloseModal} />
85+
<ParentsDisabledAlarmModal handleCloseModal={handleCloseModal} errMsg={errMsg} />
8586
</ParentsDisabledAlarmModalWrapper>
8687
)}
8788
<ToastModal>
@@ -129,6 +130,7 @@ const StudentNameWrapper = styled.h1`
129130
`;
130131

131132
const Content = styled.p`
133+
margin: 0 0.2rem;
132134
color: ${({ theme }) => theme.colors.grey900};
133135
${({ theme }) => theme.fonts.body02};
134136
`;
@@ -138,7 +140,7 @@ const ContentWrapper = styled.article`
138140
justify-content: center;
139141
align-items: center;
140142
141-
/* width: 18.7rem; */
143+
width: 18.7rem;
142144
margin-bottom: 1rem;
143145
`;
144146

โ€Žsrc/components/common/ToastModal.tsxโ€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ const ModalWrapper = styled.div`
5656
position: fixed;
5757
z-index: 2;
5858
59-
width: 32rem;
60-
height: 100dvh;
59+
width: 33rem;
60+
height: 104vh;
6161
62+
margin-top: -4rem;
6263
background-color: rgb(33 37 41 / 60%);
6364
6465
cursor: pointer;
@@ -71,7 +72,7 @@ const Modal = styled.aside`
7172
7273
width: 32rem;
7374
/* TODO ์ด ํŒจ๋”ฉ์ด ๋ฒ„ํŠผ ์„ธ๊ฐœ์ธ ๋ชจ๋‹ฌ์— ๋งž๋Š” ํŒจ๋”ฉ */
74-
padding: 1.6rem 1.4rem 4.5rem;
75+
padding: 1.6rem 1.8rem 4.5rem;
7576
padding-top: 1.6rem;
7677
7778
background-color: ${({ theme }) => theme.colors.white};

โ€Žsrc/components/modal/ParentsDisabledAlarmModal.tsxโ€Ž

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,24 @@ import BasicSingleModal from "../common/BasicSingleModal";
33

44
interface ParentsDisabledAlarmModalProp {
55
handleCloseModal(): void;
6+
errMsg?: string;
67
}
78

89
export default function ParentsDisabledAlarmModal(props: ParentsDisabledAlarmModalProp) {
9-
const { handleCloseModal } = props;
10+
const { handleCloseModal, errMsg } = props;
1011

1112
return (
1213
<BasicSingleModal buttonName="ํ™•์ธ" handleClickSingleButton={handleCloseModal}>
13-
<CancleImpossibleTitle>
14-
ํ‘ธ์‰ฌ์•Œ๋ฆผ ์ƒ๋Œ€๊ฐ€
15-
<br />
16-
์•Œ๋ฆผ์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค
17-
</CancleImpossibleTitle>
14+
<CancelImpossibleTitle>{errMsg}</CancelImpossibleTitle>
1815
</BasicSingleModal>
1916
);
2017
}
2118

22-
const CancleImpossibleTitle = styled.h1`
19+
const CancelImpossibleTitle = styled.h1`
2320
display: flex;
2421
justify-content: center;
2522
text-align: center;
23+
width: 50%;
2624
2725
${({ theme }) => theme.fonts.body02};
2826
`;

0 commit comments

Comments
ย (0)