Skip to content

Commit 4c09a27

Browse files
Merge pull request #60 from dib3474/feature/error-page
2 parents 121d060 + 97b126f commit 4c09a27

49 files changed

Lines changed: 942 additions & 383 deletions

File tree

Some content is hidden

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

package-lock.json

Lines changed: 26 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"react-dom": "^19.1.1",
2525
"react-error-boundary": "^6.0.0",
2626
"react-router-dom": "^7.8.2",
27+
"react-toastify": "^11.0.5",
2728
"sockjs-client": "^1.6.1"
2829
},
2930
"devDependencies": {

public/lost404.svg

Lines changed: 211 additions & 0 deletions
Loading

src/App.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@ import { QueryClientProvider } from '@tanstack/react-query';
44
import { queryClient } from '@/utils/queryClient';
55
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
66
import { AuthProvider } from '@/context/AuthContext';
7+
import { ToastContainer } from 'react-toastify';
8+
import { ErrorBoundary } from 'react-error-boundary';
9+
import ErrorComponent from './components/common/ErrorComponent';
710

811
const App = () => {
912
return (
10-
<QueryClientProvider client={queryClient}>
11-
<AuthProvider>
12-
<BrowserRouter>
13-
<Routes />
14-
</BrowserRouter>
15-
</AuthProvider>
16-
{import.meta.env.VITE_ENABLE_RQ_DEVTOOLS === 'true' && <ReactQueryDevtools />}
17-
</QueryClientProvider>
13+
<ErrorBoundary
14+
FallbackComponent={() => <ErrorComponent isGlobal={true} showBackButton={false} />}
15+
>
16+
<QueryClientProvider client={queryClient}>
17+
<AuthProvider>
18+
<BrowserRouter>
19+
<Routes />
20+
</BrowserRouter>
21+
</AuthProvider>
22+
<ToastContainer />
23+
{import.meta.env.VITE_ENABLE_RQ_DEVTOOLS === 'true' && <ReactQueryDevtools />}
24+
</QueryClientProvider>
25+
</ErrorBoundary>
1826
);
1927
};
2028

src/__tests__/components/common/__snapshots__/Button.test.tsx.snap

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`Button 컴포넌트 > 스냅샷 테스트 > disabled Button 스냅샷 1`] = `
44
<button
5-
class="flex items-center justify-center w-fit cursor-not-allowed bg-primary-300 text-gray-50 text-md rounded-xl px-5 py-3 undefined opacity-50"
5+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-not-allowed bg-primary-300 text-gray-50 active:bg-primary-400 text-md rounded-xl px-5 py-3 undefined opacity-50"
66
disabled=""
77
type="button"
88
>
@@ -12,7 +12,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > disabled Button 스냅샷 1
1212

1313
exports[`Button 컴포넌트 > 스냅샷 테스트 > fullWidth Button 스냅샷 1`] = `
1414
<button
15-
class="flex items-center justify-center w-full cursor-pointer bg-primary-300 text-gray-50 text-md rounded-xl px-5 py-3 undefined "
15+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-full cursor-pointer bg-primary-300 text-gray-50 active:bg-primary-400 text-md rounded-xl px-5 py-3 undefined "
1616
type="button"
1717
>
1818
전체 너비 버튼
@@ -21,7 +21,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > fullWidth Button 스냅샷
2121

2222
exports[`Button 컴포넌트 > 스냅샷 테스트 > icon variant 스냅샷 1`] = `
2323
<button
24-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 undefined "
24+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 undefined "
2525
type="button"
2626
>
2727
아이콘 버튼
@@ -30,7 +30,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > icon variant 스냅샷 1`]
3030

3131
exports[`Button 컴포넌트 > 스냅샷 테스트 > lg size 스냅샷 1`] = `
3232
<button
33-
class="flex items-center justify-center w-fit cursor-pointer bg-primary-300 text-gray-50 text-lg rounded-2xl px-6 py-4 undefined "
33+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-primary-300 text-gray-50 active:bg-primary-400 text-lg rounded-2xl px-6 py-4 undefined "
3434
type="button"
3535
>
3636
큰 버튼
@@ -39,7 +39,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > lg size 스냅샷 1`] = `
3939

4040
exports[`Button 컴포넌트 > 스냅샷 테스트 > link variant 스냅샷 1`] = `
4141
<button
42-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-400 text-sm !p-0 !rounded-none text-md rounded-xl px-5 py-3 undefined "
42+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-400 text-sm !p-0 !rounded-none text-md rounded-xl px-5 py-3 undefined "
4343
type="button"
4444
>
4545
링크 버튼
@@ -48,7 +48,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > link variant 스냅샷 1`]
4848

4949
exports[`Button 컴포넌트 > 스냅샷 테스트 > md size 스냅샷 1`] = `
5050
<button
51-
class="flex items-center justify-center w-fit cursor-pointer bg-primary-300 text-gray-50 text-md rounded-xl px-5 py-3 undefined "
51+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-primary-300 text-gray-50 active:bg-primary-400 text-md rounded-xl px-5 py-3 undefined "
5252
type="button"
5353
>
5454
중간 버튼
@@ -57,7 +57,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > md size 스냅샷 1`] = `
5757

5858
exports[`Button 컴포넌트 > 스냅샷 테스트 > primary variant 스냅샷 1`] = `
5959
<button
60-
class="flex items-center justify-center w-fit cursor-pointer bg-primary-300 text-gray-50 text-md rounded-xl px-5 py-3 undefined "
60+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-primary-300 text-gray-50 active:bg-primary-400 text-md rounded-xl px-5 py-3 undefined "
6161
type="button"
6262
>
6363
주 버튼
@@ -66,7 +66,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > primary variant 스냅샷 1
6666

6767
exports[`Button 컴포넌트 > 스냅샷 테스트 > secondary variant 스냅샷 1`] = `
6868
<button
69-
class="flex items-center justify-center w-fit cursor-pointer bg-primary-50 text-primary-300 text-md rounded-xl px-5 py-3 undefined "
69+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-primary-50 text-primary-300 active:bg-primary-100 text-md rounded-xl px-5 py-3 undefined "
7070
type="button"
7171
>
7272
보조 버튼
@@ -75,7 +75,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > secondary variant 스냅샷
7575

7676
exports[`Button 컴포넌트 > 스냅샷 테스트 > sm size 스냅샷 1`] = `
7777
<button
78-
class="flex items-center justify-center w-fit cursor-pointer bg-primary-300 text-gray-50 text-sm rounded-lg px-4 py-2 undefined "
78+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-primary-300 text-gray-50 active:bg-primary-400 text-sm rounded-lg px-4 py-2 undefined "
7979
type="button"
8080
>
8181
작은 버튼
@@ -84,7 +84,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > sm size 스냅샷 1`] = `
8484

8585
exports[`Button 컴포넌트 > 스냅샷 테스트 > socialLogin variant 스냅샷 1`] = `
8686
<button
87-
class="flex items-center justify-center w-fit cursor-pointer border transition-colors duration-200 text-md rounded-xl px-5 py-3 undefined "
87+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer border transition-colors duration-200 text-md rounded-xl px-5 py-3 undefined "
8888
type="button"
8989
>
9090
소셜 로그인 버튼
@@ -93,7 +93,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > socialLogin variant 스냅
9393

9494
exports[`Button 컴포넌트 > 스냅샷 테스트 > tertiary variant 스냅샷 1`] = `
9595
<button
96-
class="flex items-center justify-center w-fit cursor-pointer bg-gray-100 text-gray-600 text-md rounded-xl px-5 py-3 undefined "
96+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-gray-100 text-gray-600 active:bg-gray-200 text-md rounded-xl px-5 py-3 undefined "
9797
type="button"
9898
>
9999
3차 버튼
@@ -102,7 +102,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > tertiary variant 스냅샷
102102

103103
exports[`Button 컴포넌트 > 스냅샷 테스트 > text variant 스냅샷 1`] = `
104104
<button
105-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md !p-0 !rounded-none text-md rounded-xl px-5 py-3 undefined "
105+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md !p-0 !rounded-none text-md rounded-xl px-5 py-3 undefined "
106106
type="button"
107107
>
108108
텍스트 버튼
@@ -111,7 +111,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > text variant 스냅샷 1`]
111111

112112
exports[`Button 컴포넌트 > 스냅샷 테스트 > 기본 Button 컴포넌트 스냅샷 1`] = `
113113
<button
114-
class="flex items-center justify-center w-fit cursor-pointer bg-primary-300 text-gray-50 text-md rounded-xl px-5 py-3 undefined "
114+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-primary-300 text-gray-50 active:bg-primary-400 text-md rounded-xl px-5 py-3 undefined "
115115
type="button"
116116
>
117117
기본 버튼
@@ -120,7 +120,7 @@ exports[`Button 컴포넌트 > 스냅샷 테스트 > 기본 Button 컴포넌트
120120

121121
exports[`Button 컴포넌트 > 스냅샷 테스트 > 커스텀 className과 props가 적용된 Button 스냅샷 1`] = `
122122
<button
123-
class="flex items-center justify-center w-full cursor-pointer bg-primary-50 text-primary-300 text-lg rounded-2xl px-6 py-4 custom-class "
123+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-full cursor-pointer bg-primary-50 text-primary-300 active:bg-primary-100 text-lg rounded-2xl px-6 py-4 custom-class "
124124
data-testid="snapshot-button"
125125
id="test-button"
126126
type="button"

src/__tests__/components/common/__snapshots__/Footer.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`Footer 컴포넌트 > 기본 렌더링 > 기본 상태 스냅샷 - 선택된 버튼 없음 > footer-button-structure 1`] = `
44
<button
5-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 flex-col text-xs pt-2 pb-3 px-3 "
5+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 flex-col text-xs pt-2 pb-3 px-3 "
66
type="button"
77
>
88
<svg
@@ -31,7 +31,7 @@ exports[`Footer 컴포넌트 > 기본 렌더링 > 기본 상태 스냅샷 - 선
3131

3232
exports[`Footer 컴포넌트 > 기본 렌더링 > 선택된 상태 스냅샷 - home 선택 > selected-button 1`] = `
3333
<button
34-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 flex-col text-xs pt-2 pb-3 px-3 "
34+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 flex-col text-xs pt-2 pb-3 px-3 "
3535
type="button"
3636
>
3737
<svg
@@ -60,7 +60,7 @@ exports[`Footer 컴포넌트 > 기본 렌더링 > 선택된 상태 스냅샷 - h
6060

6161
exports[`Footer 컴포넌트 > 기본 렌더링 > 선택된 상태 스냅샷 - home 선택 > unselected-button 1`] = `
6262
<button
63-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 flex-col text-xs pt-2 pb-3 px-3 "
63+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 flex-col text-xs pt-2 pb-3 px-3 "
6464
type="button"
6565
>
6666
<svg
@@ -89,7 +89,7 @@ exports[`Footer 컴포넌트 > 기본 렌더링 > 선택된 상태 스냅샷 - h
8989

9090
exports[`Footer 컴포넌트 > 상호작용 테스트 > 버튼 클릭 시 폰트가 볼드로 변경된다 > clicked-home-button 1`] = `
9191
<button
92-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 flex-col text-xs pt-2 pb-3 px-3 "
92+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 flex-col text-xs pt-2 pb-3 px-3 "
9393
type="button"
9494
>
9595
<svg

src/__tests__/components/common/__snapshots__/Header.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`Header 컴포넌트 > 스냅샷 테스트 - 핵심 요소별 > all vari
55
class="flex-1 flex justify-start"
66
>
77
<button
8-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 undefined "
8+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 undefined "
99
type="button"
1010
>
1111
<svg
@@ -34,7 +34,7 @@ exports[`Header 컴포넌트 > 스냅샷 테스트 - 핵심 요소별 > all vari
3434
class="flex-1 flex justify-end items-center "
3535
>
3636
<button
37-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 h-6 w-6 !p-0 rounded-lg flex items-center justify-center "
37+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 h-6 w-6 !p-0 rounded-lg flex items-center justify-center "
3838
type="button"
3939
>
4040
<svg
@@ -55,7 +55,7 @@ exports[`Header 컴포넌트 > 스냅샷 테스트 - 핵심 요소별 > all vari
5555
</svg>
5656
</button>
5757
<button
58-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 h-6 w-6 !p-0 rounded-lg flex items-center justify-center mr-5 "
58+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 h-6 w-6 !p-0 rounded-lg flex items-center justify-center mr-5 "
5959
type="button"
6060
>
6161
<svg
@@ -126,7 +126,7 @@ exports[`Header 컴포넌트 > 스냅샷 테스트 - 핵심 요소별 > logo var
126126

127127
exports[`Header 컴포넌트 > 스냅샷 테스트 - 핵심 요소별 > page variant - 네비게이션 구조 스냅샷 > page-variant-back-button 1`] = `
128128
<button
129-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 undefined "
129+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-md rounded-xl px-5 py-3 undefined "
130130
type="button"
131131
>
132132
<svg

src/__tests__/pages/__snapshots__/ChatPage.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ exports[`ChatPage > 스냅샷 - 전송 컴포넌트 > chat-send-section 1`] = `
6161
/>
6262
<button
6363
aria-label="image"
64-
class="flex items-center justify-center w-fit cursor-pointer bg-transparent text-gray-900 text-sm rounded-lg px-4 py-2 shrink-0 rounded-full text-sm "
64+
class="flex items-center justify-center hover:opacity-90 transition-opacity duration-100 w-fit cursor-pointer bg-transparent text-gray-900 text-sm rounded-lg px-4 py-2 shrink-0 rounded-full text-sm "
6565
type="button"
6666
>
6767
<img

0 commit comments

Comments
 (0)