diff --git a/.eslintrc.js b/.eslintrc.js index 23ac828..51fd4ac 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,7 +7,7 @@ module.exports = { }, parser: '@typescript-eslint/parser', parserOptions: { - project: './tsconfig.eslint.json', + project: path.join(__dirname, 'tsconfig.json'), tsconfigRootDir: __dirname, }, extends: ['plugin:@typescript-eslint/recommended', 'airbnb', 'airbnb/hooks', 'prettier'], @@ -74,5 +74,13 @@ module.exports = { }, }, }, - ignorePatterns: ['.eslintrc.js', 'dist', 'test/**/*'], + ignorePatterns: [ + '.eslintrc.js', + 'babel.config.js', + 'webpack.config.js', + 'webpack.dev.config.js', + 'server/**/*', + 'dist', + 'test/**/*', + ], }; diff --git a/.husky/_/pre-commit b/.husky/_/pre-commit index 10ee492..16aae78 100644 --- a/.husky/_/pre-commit +++ b/.husky/_/pre-commit @@ -1,2 +1,2 @@ #!/usr/bin/env sh - +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/front/public/_redirects b/front/public/_redirects deleted file mode 100644 index 50a4633..0000000 --- a/front/public/_redirects +++ /dev/null @@ -1 +0,0 @@ -/* /index.html 200 \ No newline at end of file diff --git a/front/src/apis/api.instance.ts b/front/src/apis/api.instance.ts index b259fdf..6959077 100644 --- a/front/src/apis/api.instance.ts +++ b/front/src/apis/api.instance.ts @@ -1,5 +1,5 @@ import axios, { AxiosError, AxiosInstance } from 'axios'; -import { CookieKey } from '../utils/constants'; +import { CookieKey } from '../constants/app.config'; import { getCookie, removeCookie } from '../utils/cookie'; const api: AxiosInstance = axios.create(); diff --git a/front/src/apis/services/freeboard.api.ts b/front/src/apis/services/freeboard.api.ts index d019bdb..69d77ec 100644 --- a/front/src/apis/services/freeboard.api.ts +++ b/front/src/apis/services/freeboard.api.ts @@ -1,5 +1,3 @@ -/* eslint-disable max-classes-per-file */ -/* eslint-disable no-undef */ import { NewsDetail, NewsFeed } from '../../types/newFeed.type'; export const NEWS_URL = 'https://api.hnpwa.com/v0/news/1.json'; diff --git a/front/src/apis/services/user.api.ts b/front/src/apis/services/user.api.ts index d38e12f..5a15563 100644 --- a/front/src/apis/services/user.api.ts +++ b/front/src/apis/services/user.api.ts @@ -1,4 +1,3 @@ -import axios from 'axios'; import { UserState } from '../../store/slices/userSlice'; // 실제 백엔드 API가 있다면 이 부분을 해당 API 호출로 변경해야 합니다. diff --git a/front/src/app.tsx b/front/src/app.tsx index dfaefe2..12aef01 100644 --- a/front/src/app.tsx +++ b/front/src/app.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { BrowserRouter as Router } from 'react-router-dom'; -import ErrorBoundary from './components/ErrorBoundary'; -import GoogleAnalytics from './components/GoogleAnalytics'; +import ErrorBoundary from './components/providers/ErrorBoundary'; +import GoogleAnalytics from './components/providers/GoogleAnalytics'; import AppRouter from './routes/AppRouter'; const App: React.FC = () => ( diff --git a/front/src/assets/netflix.png b/front/src/assets/netflix.png deleted file mode 100644 index 04c02dd..0000000 Binary files a/front/src/assets/netflix.png and /dev/null differ diff --git a/front/src/components/Section.tsx b/front/src/components/Section.tsx deleted file mode 100644 index eb76456..0000000 --- a/front/src/components/Section.tsx +++ /dev/null @@ -1,92 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies */ -import { Box, Button, Meter, Stack, Text } from 'grommet'; -import { Trash } from 'grommet-icons'; -import React from 'react'; -import { timeFormatter } from '../utils/utils'; - -interface SectionProps { - id: string; - est: number; - act: number; - title: string; - isDiscuss: boolean; - removeSection: (id: string) => void; - startDiscuss: (id: string) => void; - stopDiscuss: (id: string) => void; -} - -export const Section: React.FC = ({ - id, - est, - act, - title, - isDiscuss, - removeSection, - startDiscuss, - stopDiscuss, -}) => { - const initTime = est * 60; - const remainingTime = () => initTime - act; - - return ( - - - - {timeFormatter(initTime)} - - - - - {timeFormatter(act)} - - - - - - {title} - - - - - - - - ); }; diff --git a/front/src/pages/error/GlobalError.tsx b/front/src/pages/error/GlobalError.tsx index 171ea17..b7db8d1 100644 --- a/front/src/pages/error/GlobalError.tsx +++ b/front/src/pages/error/GlobalError.tsx @@ -1,15 +1,11 @@ import React from 'react'; -import { CommonButton } from '../../styles/common.style'; +import { Button } from '../../components/commons'; const GlobalError: React.FC = () => { const goMain = () => { window.location.href = '/'; }; - const handleReload = () => { - window.location.reload(); - }; - return (
{ flexDirection: 'column', alignItems: 'center', justifyContent: 'center', - height: '60vh', + height: '80vh', textAlign: 'center', }} > -

Error

-

문제가 발생했습니다.

-

- 예기치 못한 오류가 발생하여 앱을 불러올 수 없습니다. -
- 잠시 후 다시 시도해 주세요. -

-
- - 다시 시도 - - - 메인으로 이동 - -
+

오류가 발생했습니다

+

문제가 지속되면 관리자에게 문의해 주세요.

+
); }; diff --git a/front/src/pages/error/NotFound.tsx b/front/src/pages/error/NotFound.tsx index 555d0bb..8ed55a3 100644 --- a/front/src/pages/error/NotFound.tsx +++ b/front/src/pages/error/NotFound.tsx @@ -1,8 +1,8 @@ import * as Sentry from '@sentry/react'; import React from 'react'; import { useNavigate } from 'react-router-dom'; -import { CommonButton } from '../../styles/common.style'; -import { RouteLink } from '../../utils/constants'; +import { Button } from '../../components/commons'; +import { RouteLink } from '../../routes/routes'; const NotFound: React.FC = () => { const navigate = useNavigate(); @@ -38,9 +38,9 @@ const NotFound: React.FC = () => {

입력하신 주소가 잘못되었거나, 페이지가 이동 또는 삭제되었을 수 있습니다.

- + ); }; diff --git a/front/src/pages/freeboard/FreeBoardDetail.tsx b/front/src/pages/freeboard/FreeBoardDetail.tsx index 8064343..3de3d7b 100644 --- a/front/src/pages/freeboard/FreeBoardDetail.tsx +++ b/front/src/pages/freeboard/FreeBoardDetail.tsx @@ -4,9 +4,9 @@ import { useQuery } from '@tanstack/react-query'; import React, { useEffect } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import APIs from '../../apis'; +import { Button, Title } from '../../components/commons'; import { useAppDispatch } from '../../store/hooks'; import { makeRead } from '../../store/slices/newsSlice'; -import { CommonButton, CommonTitle } from '../../styles/common.style'; import { NewsComment } from '../../types/newFeed.type'; const Comment: React.FC<{ comment: NewsComment }> = ({ comment }) => ( @@ -61,7 +61,7 @@ const FreeBoardDetail: React.FC = () => { return (
- 자유게시판 상세보기 + 자유게시판 상세보기

{title}

@@ -86,12 +86,12 @@ const FreeBoardDetail: React.FC = () => {
- navigate(-1)} style={{ width: 'auto', padding: '10px 24px', backgroundColor: '#86868b' }} > 목록 - +
); diff --git a/front/src/pages/freeboard/FreeBoardList.tsx b/front/src/pages/freeboard/FreeBoardList.tsx index 6099084..a7330e5 100644 --- a/front/src/pages/freeboard/FreeBoardList.tsx +++ b/front/src/pages/freeboard/FreeBoardList.tsx @@ -2,9 +2,9 @@ import { useQuery } from '@tanstack/react-query'; import React from 'react'; import { Link, useNavigate, useParams } from 'react-router-dom'; import APIs from '../../apis'; -import { CommonTitle } from '../../styles/common.style'; +import { Button, Title } from '../../components/commons'; +import { RouteLink } from '../../routes/routes'; import { NewsFeed } from '../../types/newFeed.type'; -import { RouteLink } from '../../utils/constants'; export const FreeBoardList: React.FC = () => { const { page = '1' } = useParams(); @@ -90,7 +90,7 @@ export const FreeBoardList: React.FC = () => { return (
- 자유게시판 목록 + 자유게시판 목록
@@ -112,7 +112,8 @@ export const FreeBoardList: React.FC = () => { }} >
- + {Array.from({ length: lastPage }, (_, i) => ( - + ))} - +
diff --git a/front/src/pages/login/index.tsx b/front/src/pages/login/index.tsx index dfd4876..18f9f92 100644 --- a/front/src/pages/login/index.tsx +++ b/front/src/pages/login/index.tsx @@ -1,10 +1,11 @@ import React, { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; +import { Button, Form, Image, Input, InputHelperText } from '../../components/commons'; +import { LoginLayout } from '../../components/layouts/layout.style'; +import { UserRole } from '../../constants/app.config'; import useAuth from '../../hooks/useAuth'; -import { CommonButton, CommonForm, CommonImage, CommonInput, CommonInputText } from '../../styles/common.style'; -import { LoginLayout } from '../../styles/layout.style'; -import { RouteLink, UserRole } from '../../utils/constants'; -import { sampeople } from '../../utils/image.import'; +import { RouteLink } from '../../routes/routes'; +import { sampeople } from '../../utils/images'; const Login: React.FC = () => { const { login: authLogin, logout: authLogout } = useAuth(); @@ -44,16 +45,16 @@ const Login: React.FC = () => { return ( - + logo - - - - {msg} +
+ + + {msg} - 로그인 - + +
); }; diff --git a/front/src/pages/main/index.tsx b/front/src/pages/main/index.tsx index a131c21..95dd656 100644 --- a/front/src/pages/main/index.tsx +++ b/front/src/pages/main/index.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { CommonSubTitle, CommonTitle } from '../../styles/common.style'; +import { SubTitle, Title } from '../../components/commons'; const Main: React.FC = () => { const [time, setTime] = useState(new Date()); @@ -14,8 +14,8 @@ const Main: React.FC = () => { return ( <> - Welcome to Sampeople - Current Time: {time.toLocaleString()} + Welcome to Sampeople + Current Time: {time.toLocaleString()} ); }; diff --git a/front/src/pages/mypage/index.tsx b/front/src/pages/mypage/index.tsx index 31b8d44..f67f94d 100644 --- a/front/src/pages/mypage/index.tsx +++ b/front/src/pages/mypage/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; +import { Button, Input, Title } from '../../components/commons'; import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { updateUserInfo } from '../../store/slices/userSlice'; -import { CommonButton, CommonInput, CommonTitle } from '../../styles/common.style'; const MyPage: React.FC = () => { const dispatch = useAppDispatch(); @@ -48,20 +48,27 @@ const MyPage: React.FC = () => { alert('회원정보가 수정되었습니다.'); }; + const getGenderText = (gender: string) => { + if (gender === 'M') return '남성'; + if (gender === 'F') return '여성'; + return '-'; + }; + return (
- 마이페이지 + 마이페이지
{/* 아이디 / 이름 섹션 */}
-
- - + 이름 + + { {/* 생년월일 / 성별 섹션 */}
-
- - + 성별 + + { {/* 휴대폰 번호 섹션 */}
-