Skip to content

Commit 530e5c2

Browse files
authored
Merge pull request #476 from Gwasuwon-shot/develop
release 1.2.2
2 parents 281fb57 + 78da40d commit 530e5c2

File tree

139 files changed

+1605
-649
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+1605
-649
lines changed

.eslintrc.cjs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
module.exports = {
22
parser: "@typescript-eslint/parser",
3-
plugins: ["@typescript-eslint", "prettier"],
3+
parserOptions: {
4+
ecmaVersion: 2020,
5+
sourceType: "module",
6+
},
7+
settings: {
8+
react: {
9+
version: "detect",
10+
},
11+
},
12+
plugins: ["@typescript-eslint", "prettier", "react", "simple-import-sort"],
413
extends: [
514
"airbnb",
615
"plugin:import/errors",
716
"plugin:import/warnings",
817
"plugin:prettier/recommended",
918
"plugin:@typescript-eslint/recommended",
10-
"prettier/@typescript-eslint",
19+
"plugin:react/recommended",
20+
"prettier",
1121
],
1222
rules: {
1323
"linebreak-style": 0,
@@ -22,6 +32,7 @@ module.exports = {
2232
"eol-last": ["error", "always"], // line의 가장 마지막 줄에는 개행 넣기
2333
"react/react-in-jsx-scope": "off",
2434
"no-multi-spaces": "error", // 스페이스 여러개 금지
25-
"simple-import-sort/imports": "error"
35+
"simple-import-sort/imports": "error",
36+
"no-use-before-define": ["error", false],
2637
},
2738
};

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.19.0
1+
v18.20.3

package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc && vite build",
9-
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
9+
"lint": "eslint",
1010
"stylelint": "stylelint './src/**/*.tsx' --fix",
1111
"preview": "vite preview"
1212
},
@@ -31,6 +31,7 @@
3131
"react-copy-to-clipboard": "^5.1.0",
3232
"react-dom": "^18.2.0",
3333
"react-error-boundary": "^4.0.11",
34+
"react-ga4": "^2.1.0",
3435
"react-konva": "^18.2.10",
3536
"react-query": "^3.39.3",
3637
"react-router-dom": "^6.23.0",
@@ -58,13 +59,20 @@
5859
"@typescript-eslint/parser": "^5.59.0",
5960
"@vitejs/plugin-react": "^4.0.0",
6061
"eslint": "^8.44.0",
61-
"eslint-plugin-react-hooks": "^4.6.0",
62+
"eslint-config-airbnb": "^19.0.4",
63+
"eslint-config-prettier": "^9.1.0",
64+
"eslint-plugin-import": "^2.29.1",
65+
"eslint-plugin-jsx-a11y": "^6.8.0",
66+
"eslint-plugin-prettier": "^5.1.3",
67+
"eslint-plugin-react": "^7.34.2",
68+
"eslint-plugin-react-hooks": "^4.6.2",
6269
"eslint-plugin-react-refresh": "^0.3.4",
70+
"eslint-plugin-simple-import-sort": "^12.1.0",
6371
"postcss": "^8.4.25",
6472
"postcss-styled-syntax": "^0.4.0",
6573
"prettier": "^3.0.0",
6674
"slick-carousel": "^1.8.1",
67-
"typescript": "^5.0.2",
75+
"typescript": "5.1.6",
6876
"vite": "^4.3.9"
6977
}
7078
}

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ import Router from "./Router";
44
import "./core/notification/settingFCM";
55
import { GlobalStyle } from "./style/globalStyle";
66
import { theme } from "./style/theme";
7+
import REACTGA from "react-ga4";
78

89
export default function App() {
10+
REACTGA.initialize(import.meta.env.VITE_APP_GOOGLE_ANALYTICS);
11+
912
return (
1013
<RecoilRoot>
1114
<ThemeProvider theme={theme}>

src/Router.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import * as Sentry from "@sentry/react";
2-
import { BrowserRouter, Route, Routes } from "react-router-dom";
2+
import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
33

4+
import { AxiosError } from "axios";
45
import { Suspense } from "react";
5-
import { ErrorBoundary } from "react-error-boundary";
6+
import { removeCookie } from "./api/cookie";
67
import ConnectParentsAndTeacher from "./components/RegularLesson/ConnectParentsAndTeacher";
78
import AfterSignup from "./components/welcomeSignup/AfterSignup";
89
import AllowAlert from "./components/welcomeSignup/AllowAlert";
@@ -38,12 +39,17 @@ import TimePickerPage from "./pages/TimePickerPage";
3839
import TuitionPayment from "./pages/TuitionPayment";
3940
import WelcomeSignup from "./pages/WelcomeSignup";
4041
import PrivateRoute from "./utils/common/privateRoute";
42+
interface fallbackProps {
43+
error: Error;
44+
resetError: () => void;
45+
}
4146

4247
export default function Router() {
48+
4349
return (
4450
<BrowserRouter>
4551
<Sentry.ErrorBoundary fallback={fallbackRender}>
46-
<ErrorBoundary FallbackComponent={fallbackRender}>
52+
{/* <ErrorBoundary FallbackComponent={fallbackRender}> */}
4753
<Suspense fallback={<Loading />}>
4854
<Routes>
4955
<Route path="/" element={<OnBoarding />} />
@@ -85,20 +91,18 @@ export default function Router() {
8591
</Route>
8692
</Routes>
8793
</Suspense>
88-
</ErrorBoundary>
94+
{/* </ErrorBoundary> */}
8995
</Sentry.ErrorBoundary>
9096
</BrowserRouter>
9197
);
9298
}
9399

94-
function fallbackRender({ error, resetErrorBoundary }: any) {
95-
// if (error.response) {
96-
// if (error.response.data.code === 401) {
97-
// resetErrorBoundary();
98-
// removeCookie("accessToken");
99-
// return <Navigate to="/" />;
100-
// }
101-
// } else {
102-
return <ErrorPage resetErrorBoundary={resetErrorBoundary} />;
103-
// }
100+
function fallbackRender({ error, resetError }:fallbackProps) {
101+
if ( error instanceof AxiosError && error.response?.status === 401) {
102+
resetError();
103+
removeCookie("accessToken");
104+
return <Navigate to="/" />;
105+
} else {
106+
return <ErrorPage resetErrorBoundary={resetError} />;
107+
}
104108
}

src/api/createLesson.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ export async function createLesson(props: createLessonProps) {
3333
`/api/lesson`,
3434
{
3535
lesson: {
36-
studentName: studentName,
37-
subject: subject,
38-
payment: payment,
39-
amount: amount,
40-
count: count,
41-
startDate: startDate,
42-
regularScheduleList: regularScheduleList,
36+
studentName,
37+
subject,
38+
payment,
39+
amount,
40+
count,
41+
startDate,
42+
regularScheduleList,
4343
},
4444
account: {
4545
// name: name,
46-
bank: bank,
47-
number: number,
46+
bank,
47+
number,
4848
},
4949
},
5050
{

src/api/createLessonMaintenance.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from "axios";
2+
23
import { getCookie } from "./cookie";
34

45
interface createLessonMaintenanceProps {
@@ -12,8 +13,8 @@ export async function createLessonMaintenance(props: createLessonMaintenanceProp
1213
const data = await axios.post(
1314
`${import.meta.env.VITE_APP_BASE_URL}/api/lesson/maintenance`,
1415
{
15-
lessonIdx: lessonIdx,
16-
isLessonMaintenance: isLessonMaintenance,
16+
lessonIdx,
17+
isLessonMaintenance,
1718
},
1819
{
1920
headers: {

src/api/deleteLesson.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from "axios";
2+
23
import { getCookie } from "./cookie";
34

45
export async function deleteLesson(lessonIdx: number) {

src/api/getAttendanceExist.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from "axios";
2+
23
import { getCookie } from "./cookie";
34

45
export async function getAttendanceExist(scheduleIdx: number) {

src/api/getDepositRecord.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from "axios";
2+
23
import { getCookie } from "./cookie";
34

45
export async function getDepositRecord(lessonId: number) {

0 commit comments

Comments
 (0)