Skip to content

Commit e4eb523

Browse files
authored
[25.03.10 / TASK-141] 트래커 제거 및 폴더 구조 정리 (#24)
* refactor: 트래커 제거 * refactor: 폴더 경로 정리
1 parent 60486b0 commit e4eb523

Some content is hidden

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

44 files changed

+45
-159
lines changed

src/__test__/login.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { act, screen } from '@testing-library/react';
33
import { ToastContainer } from 'react-toastify';
44
import { useRouter } from 'next/navigation';
55
import { renderWithQueryClient } from '@/utils/componentUtil';
6-
import { default as Login } from '@/app/(with-tracker)/(login)/page';
6+
import { default as Login } from '@/app/(login)/page';
77

88
jest.mock('next/navigation', () => ({
99
useRouter: jest.fn(),

src/__test__/main.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { screen, waitFor } from '@testing-library/react';
22
import { renderWithQueryClient } from '@/utils';
3-
import { Content } from '@/app/(with-tracker)/(auth-required)/main/Content';
3+
import { Content } from '@/app/(auth-required)/main/Content';
44
import { Header } from '@/components';
55

66
jest.mock('next/navigation', () => ({

src/app/(with-tracker)/(auth-required)/compare/page.tsx renamed to src/app/(auth-required)/compare/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { Metadata } from 'next';
22
import { ArriveSoon } from '@/components';
33

4-
export const metadata: Metadata = {
5-
title: '통계 비교',
6-
};
4+
export const metadata: Metadata = { title: '통계 비교' };
75

86
export default function Page() {
97
return <ArriveSoon />;

src/components/auth-required/header/Section.tsx renamed to src/app/(auth-required)/components/header/Section.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Link from 'next/link';
22
import { usePathname } from 'next/navigation';
33
import { Icon, NameType } from '@/components';
44
import { COLORS } from '@/constants';
5-
import { trackUserEvent, MessageEnum } from '@/utils/trackUtil';
65

76
export const defaultStyle =
87
'w-[180px] h-[65px] px-9 transition-all duration-300 shrink-0 max-MBI:w-[65px] max-MBI:px-0 ';
@@ -48,7 +47,6 @@ export const Section = <T extends clickType>({
4847
href={action}
4948
className={defaultStyle + navigateStyle}
5049
id="navigation"
51-
onClick={() => trackUserEvent(MessageEnum.NAVIGATE)}
5250
>
5351
<Icon
5452
size={25}

src/components/auth-required/header/index.tsx renamed to src/app/(auth-required)/components/header/index.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
'use client';
22

3-
import { useEffect, useRef, useState } from 'react';
3+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
44
import { usePathname, useRouter } from 'next/navigation';
5+
import { useEffect, useRef, useState } from 'react';
56
import Image from 'next/image';
6-
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
7+
import { revalidate } from '@/utils/revalidateUtil';
78
import { PATHS, SCREENS } from '@/constants';
89
import { NameType } from '@/components';
910
import { useResponsive } from '@/hooks';
1011
import { logout, me } from '@/apis';
11-
import { trackUserEvent, MessageEnum } from '@/utils/trackUtil';
12-
import { revalidate } from '@/utils/revalidateUtil';
13-
1412
import { defaultStyle, Section, textStyle } from './Section';
1513

1614
const PARAMS = {
@@ -121,10 +119,7 @@ export const Header = () => {
121119
<div className="cursor-pointer h-fit flex-col rounded-[4px] bg-BG-SUB hover:bg-BG-ALT shadow-BORDER-MAIN shadow-md">
122120
<button
123121
className="text-DESTRUCTIVE-SUB text-I3 p-5 max-MBI:p-4 flex whitespace-nowrap w-auto"
124-
onClick={() => {
125-
out();
126-
trackUserEvent(MessageEnum.LOGOUT);
127-
}}
122+
onClick={() => out()}
128123
>
129124
로그아웃
130125
</button>

src/app/(with-tracker)/(auth-required)/layout.tsx renamed to src/app/(auth-required)/layout.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { ReactElement } from 'react';
21
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
3-
import { Header } from '@/components';
2+
import { ReactElement } from 'react';
3+
import { getQueryClient } from '@/utils/queryUtil';
44
import { PATHS } from '@/constants';
55
import { me } from '@/apis';
6-
import { getQueryClient } from '@/utils/queryUtil';
6+
import { Header } from './components/header';
77

88
interface IProp {
99
children: ReactElement;
@@ -12,10 +12,7 @@ interface IProp {
1212
export default async function Layout({ children }: IProp) {
1313
const client = getQueryClient();
1414

15-
await client.prefetchQuery({
16-
queryKey: [PATHS.ME],
17-
queryFn: me,
18-
});
15+
await client.prefetchQuery({ queryKey: [PATHS.ME], queryFn: me });
1916

2017
return (
2118
<main className="items-center w-full h-full flex flex-col p-[50px_70px_70px_70px] transition-all max-TBL:p-[20px_30px_30px_30px] max-MBI:p-[10px_25px_25px_25px]">

src/app/(with-tracker)/(auth-required)/leaderboards/Content.tsx renamed to src/app/(auth-required)/leaderboards/Content.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use client';
22

3-
import { Dropdown, Ranker, Rank } from '@/components';
3+
import { Dropdown } from '@/components';
4+
45
import { SCREENS } from '@/constants';
56
import { useResponsive, useSearchParam } from '@/hooks';
6-
import { trackUserEvent, MessageEnum } from '@/utils/trackUtil';
7+
import { Ranker, Rank } from './components';
78

89
const data = [
910
{ rank: 1, name: '정현우', count: 1235 },
@@ -25,10 +26,7 @@ export const Content = () => {
2526
['조회수', 'views'],
2627
['좋아요', 'likes'],
2728
]}
28-
onChange={(data) => {
29-
trackUserEvent(MessageEnum.SORT_INTERACT_BOARD);
30-
setSearchParams({ type: data as string });
31-
}}
29+
onChange={(data) => setSearchParams({ type: data as string })}
3230
defaultValue={'조회수'}
3331
/>
3432
<div className="w-full flex gap-10 max-MBI:flex-col max-MBI:gap-5">

src/components/auth-required/leaderboards/Rank.tsx renamed to src/app/(auth-required)/leaderboards/components/Rank.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { IProp } from './Ranker';
1+
import type { IProp } from '../../../../components/auth-required/leaderboards/Ranker';
22

33
export const Rank = ({ name, rank, count, suffix = '회' }: IProp) => {
44
return (

0 commit comments

Comments
 (0)