Skip to content

Commit

Permalink
Merge pull request #476 from Gwasuwon-shot/develop
Browse files Browse the repository at this point in the history
release 1.2.2
  • Loading branch information
eunbeann authored Jun 28, 2024
2 parents 281fb57 + 78da40d commit 530e5c2
Show file tree
Hide file tree
Showing 139 changed files with 1,605 additions and 649 deletions.
17 changes: 14 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
},
settings: {
react: {
version: "detect",
},
},
plugins: ["@typescript-eslint", "prettier", "react", "simple-import-sort"],
extends: [
"airbnb",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:react/recommended",
"prettier",
],
rules: {
"linebreak-style": 0,
Expand All @@ -22,6 +32,7 @@ module.exports = {
"eol-last": ["error", "always"], // line의 가장 마지막 줄에는 개행 넣기
"react/react-in-jsx-scope": "off",
"no-multi-spaces": "error", // 스페이스 여러개 금지
"simple-import-sort/imports": "error"
"simple-import-sort/imports": "error",
"no-use-before-define": ["error", false],
},
};
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.19.0
v18.20.3
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint",
"stylelint": "stylelint './src/**/*.tsx' --fix",
"preview": "vite preview"
},
Expand All @@ -31,6 +31,7 @@
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.11",
"react-ga4": "^2.1.0",
"react-konva": "^18.2.10",
"react-query": "^3.39.3",
"react-router-dom": "^6.23.0",
Expand Down Expand Up @@ -58,13 +59,20 @@
"@typescript-eslint/parser": "^5.59.0",
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.44.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.3.4",
"eslint-plugin-simple-import-sort": "^12.1.0",
"postcss": "^8.4.25",
"postcss-styled-syntax": "^0.4.0",
"prettier": "^3.0.0",
"slick-carousel": "^1.8.1",
"typescript": "^5.0.2",
"typescript": "5.1.6",
"vite": "^4.3.9"
}
}
3 changes: 3 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import Router from "./Router";
import "./core/notification/settingFCM";
import { GlobalStyle } from "./style/globalStyle";
import { theme } from "./style/theme";
import REACTGA from "react-ga4";

export default function App() {
REACTGA.initialize(import.meta.env.VITE_APP_GOOGLE_ANALYTICS);

return (
<RecoilRoot>
<ThemeProvider theme={theme}>
Expand Down
32 changes: 18 additions & 14 deletions src/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as Sentry from "@sentry/react";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";

import { AxiosError } from "axios";
import { Suspense } from "react";
import { ErrorBoundary } from "react-error-boundary";
import { removeCookie } from "./api/cookie";
import ConnectParentsAndTeacher from "./components/RegularLesson/ConnectParentsAndTeacher";
import AfterSignup from "./components/welcomeSignup/AfterSignup";
import AllowAlert from "./components/welcomeSignup/AllowAlert";
Expand Down Expand Up @@ -38,12 +39,17 @@ import TimePickerPage from "./pages/TimePickerPage";
import TuitionPayment from "./pages/TuitionPayment";
import WelcomeSignup from "./pages/WelcomeSignup";
import PrivateRoute from "./utils/common/privateRoute";
interface fallbackProps {
error: Error;
resetError: () => void;
}

export default function Router() {

return (
<BrowserRouter>
<Sentry.ErrorBoundary fallback={fallbackRender}>
<ErrorBoundary FallbackComponent={fallbackRender}>
{/* <ErrorBoundary FallbackComponent={fallbackRender}> */}
<Suspense fallback={<Loading />}>
<Routes>
<Route path="/" element={<OnBoarding />} />
Expand Down Expand Up @@ -85,20 +91,18 @@ export default function Router() {
</Route>
</Routes>
</Suspense>
</ErrorBoundary>
{/* </ErrorBoundary> */}
</Sentry.ErrorBoundary>
</BrowserRouter>
);
}

function fallbackRender({ error, resetErrorBoundary }: any) {
// if (error.response) {
// if (error.response.data.code === 401) {
// resetErrorBoundary();
// removeCookie("accessToken");
// return <Navigate to="/" />;
// }
// } else {
return <ErrorPage resetErrorBoundary={resetErrorBoundary} />;
// }
function fallbackRender({ error, resetError }:fallbackProps) {
if ( error instanceof AxiosError && error.response?.status === 401) {
resetError();
removeCookie("accessToken");
return <Navigate to="/" />;
} else {
return <ErrorPage resetErrorBoundary={resetError} />;
}
}
18 changes: 9 additions & 9 deletions src/api/createLesson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ export async function createLesson(props: createLessonProps) {
`/api/lesson`,
{
lesson: {
studentName: studentName,
subject: subject,
payment: payment,
amount: amount,
count: count,
startDate: startDate,
regularScheduleList: regularScheduleList,
studentName,
subject,
payment,
amount,
count,
startDate,
regularScheduleList,
},
account: {
// name: name,
bank: bank,
number: number,
bank,
number,
},
},
{
Expand Down
5 changes: 3 additions & 2 deletions src/api/createLessonMaintenance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

interface createLessonMaintenanceProps {
Expand All @@ -12,8 +13,8 @@ export async function createLessonMaintenance(props: createLessonMaintenanceProp
const data = await axios.post(
`${import.meta.env.VITE_APP_BASE_URL}/api/lesson/maintenance`,
{
lessonIdx: lessonIdx,
isLessonMaintenance: isLessonMaintenance,
lessonIdx,
isLessonMaintenance,
},
{
headers: {
Expand Down
1 change: 1 addition & 0 deletions src/api/deleteLesson.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function deleteLesson(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getAttendanceExist.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getAttendanceExist(scheduleIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getDepositRecord.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getDepositRecord(lessonId: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLatestScheduleByTeacher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLatestScheduleByTeacher() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonAccount.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonAccount(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonByParents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonByParents() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonByTeacher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonByTeacher() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonByUser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonByUser() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonDetail.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonDetail(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonPaymentRecordByTeacher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonPaymentRecordByTeacher(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonProgress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonProgress(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonRegularSchedule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonRegularSchedule(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonSchedule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonSchedule(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonScheduleByParents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonScheduleByParents(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getLessonScheduleByTeacher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getLessonScheduleByTeacher(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getMissingAttendanceByLessonExist.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getMissingAttendanceByLessonExist(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getMissingAttendanceExist.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getMissingAttendanceExist() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getMissingAttendanceSchedule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getMissingAttendanceSchedule() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getMissingMaintenanceExist.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getMissingMaintenanceExist() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getMissingMaintenanceLesson.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getMissingMaintenanceLesson() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getPastLessonRecord.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getPastLessonRecord(lessonId: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getPaymentRecordByLesson.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getPaymentRecordByLesson(lessonIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getPaymentRecordCycle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getPaymentRecordCycle(paymentRecordIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getPaymentRecordView.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getPaymentRecordView(paymentRecordIdx: number) {
Expand Down
1 change: 1 addition & 0 deletions src/api/getScheduleByUser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getScheduleByUser(date: string) {
Expand Down
11 changes: 6 additions & 5 deletions src/api/getTemporarySchedule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

interface Day {
Expand All @@ -21,11 +22,11 @@ export async function getTemporarySchedule(props: temporaryProp) {
const data = await axios.post(
`${import.meta.env.VITE_APP_BASE_URL}/api/schedule/temporary`,
{
studentName: studentName,
subject: subject,
count: count,
startDate: startDate,
regularScheduleList: regularScheduleList,
studentName,
subject,
count,
startDate,
regularScheduleList,
},
{
headers: {
Expand Down
1 change: 1 addition & 0 deletions src/api/getTodayDate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getTodayDate() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getTodayScheduleByParents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getTodayScheduleByParents() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getTodayScheduleByTeacher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getTodayScheduleByTeacher() {
Expand Down
1 change: 1 addition & 0 deletions src/api/getTodayScheduleExist.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";

import { getCookie } from "./cookie";

export async function getTodayScheduleExist() {
Expand Down
Loading

0 comments on commit 530e5c2

Please sign in to comment.