Skip to content

Commit

Permalink
Merge pull request #211 from ODOICHON/refactor/#210
Browse files Browse the repository at this point in the history
Refactor/#210 마이페이지 관련 Lazy Loading 제거
  • Loading branch information
JunJongHun authored Dec 2, 2023
2 parents 94a8b0d + 114b16b commit f3b818e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/Routes.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { lazy } from 'react';
import { RouteObject } from 'react-router-dom';
import GlobalLayout from '@/pages/_layout';
import MyPage from './pages/Mypage';
import MyWritePage from './pages/Mypage/community/write';
import MyHomePage from './pages/Mypage/home';
import MySelfPage from './pages/Mypage/trade/myself';
import MySavesPage from './pages/Mypage/trade/saves';
import MyScrapPage from './pages/Mypage/trade/scrap';

const MainPage = lazy(() => import('@/pages/Main'));
const LoginPage = lazy(() => import('@/pages/Login'));
const SignUpPage = lazy(() => import('@/pages/SignUp'));
const AgentSignUpPage = lazy(() => import('@/pages/SignUp/AgentSignUp'));
const MyPage = lazy(() => import('@/pages/Mypage'));
const MyPageHome = lazy(() => import('@/pages/Mypage/home'));
const MyselfPage = lazy(() => import('@/pages/Mypage/trade/myself'));
const MyWritePage = lazy(() => import('@/pages/Mypage/community/write'));
const MyPageTradeScrap = lazy(() => import('@/pages/Mypage/trade/scrap'));
const MyPageSaves = lazy(() => import('@/pages/Mypage/trade/saves'));
const IntroducePage = lazy(() => import('@/pages/Introduce'));
const IntroWritePage = lazy(() => import('@/pages/Introduce/Write'));
const IntroBoardPage = lazy(() => import('@/pages/Introduce/Board'));
Expand Down Expand Up @@ -40,19 +40,19 @@ export const routes: RouteObject[] = [
children: [
{
path: 'home',
element: <MyPageHome />,
element: <MyHomePage />,
},
{
path: 'trade/myself',
element: <MyselfPage />,
element: <MySelfPage />,
},
{
path: 'trade/saves',
element: <MyPageSaves />,
element: <MySavesPage />,
},
{
path: 'trade/scrap',
element: <MyPageTradeScrap />,
element: <MyScrapPage />,
},
{
path: 'community/write',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Mypage/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type myBoardType = Omit<
'code' | 'nickName' | 'commentCount' | 'fixed'
>;

function MyPageHome() {
function MyHomePage() {
const { user } = userStore();

const { data: myBoardListData } = useQuery<
Expand Down Expand Up @@ -169,4 +169,4 @@ function MyPageHome() {
);
}

export default MyPageHome;
export default MyHomePage;
2 changes: 1 addition & 1 deletion src/pages/Mypage/trade/myself/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import useInput from '@/hooks/useInput';
import { ApiResponseWithDataType } from '@/types/apiResponseType';
import styles from './styles.module.scss';

export default function MyselfPage() {
export default function MySelfPage() {
const [search, handleSearch, setSearch] = useInput('');

const [currentPage, setCurrentPage] = useState(1);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Mypage/trade/saves/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TradeBoardType } from '@/types/Board/tradeType';
import { ApiResponseWithDataType } from '@/types/apiResponseType';
import styles from './styles.module.scss';

export default function SavesPage() {
export default function MySavesPage() {
const [currentPage, setCurrentPage] = useState(1);

const fetchMySaves = (page: number) => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Mypage/trade/scrap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type ScrapFilterType = '' | 'ONGOING' | 'COMPLETED';
const INITIAL_FILTER = '';
const INITIAL_PAGE = 1;

function ScrapPage() {
function MyScrapPage() {
const [currentPage, setCurrentPage] = useState(INITIAL_PAGE);
const [filter, setFilter] = useState<ScrapFilterType>(INITIAL_FILTER);
const { data: scrapBoardListData, isLoading: isScrapBoardListData } =
Expand Down Expand Up @@ -93,4 +93,4 @@ function ScrapPage() {
);
}

export default ScrapPage;
export default MyScrapPage;

0 comments on commit f3b818e

Please sign in to comment.