Skip to content

Commit 765a7b5

Browse files
committed
refactor: 코드리뷰 반영
1 parent e212c4c commit 765a7b5

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

app/not-found.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export const description = style({
2525
export const button = style({
2626
marginTop: "1.6rem",
2727
...themeVars.text.F14,
28-
backgroundColor: themeVars.color.white[100],
2928
color: themeVars.color.black[100],
29+
backgroundColor: themeVars.color.white[100],
3030
borderRadius: "8px",
3131
padding: "0.8rem 1.2rem",
3232
selectors: {

app/not-found.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1+
'use client'
12
import NoneImage from "@/shared/assets/2D-illust/none.svg";
23
import * as styles from "./not-found.css";
3-
import Link from "next/link";
4+
45
import { PATH } from "@/shared/constants/path";
6+
import { useRouter } from "next/navigation";
7+
58
export default function NotFound() {
9+
const router = useRouter();
10+
611
return (
712
<div className={styles.container}>
813
<NoneImage width={120} height={65} />
914
<p className={styles.title}>페이지를 찾을 수 없습니다.</p>
1015
<p className={styles.description}>
1116
찾으시는 페이지가 존재하지 않거나 </p>
1217
<p className={styles.description}>이동되었을 수 있습니다.</p>
13-
<Link href={PATH.HOME} >
14-
<button className={styles.button}>홈으로 돌아가기</button>
15-
</Link>
18+
<button
19+
onClick={() => router.push(PATH.HOME)}
20+
className={styles.button}
21+
>
22+
홈으로 돌아가기
23+
</button>
1624
</div>
1725
);
1826
}

shared/api/api-client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import ky, { type Options as KyOptions, type ResponsePromise } from "ky";
22
import { HTTP_STATUS_CODE } from "@/shared/constants/api";
33
import { HTTPError } from "ky";
4-
import Router from "next/router";
4+
import { PATH } from "@/shared/constants/path";
55

66
const API_BASE_URL =
77
process.env.NODE_ENV === "development"
@@ -23,11 +23,11 @@ const http = ky.create({
2323
const { response } = error;
2424
switch (response.status) {
2525
case HTTP_STATUS_CODE.UNAUTHORIZED: {
26-
Router.push("/login");
26+
window.location.replace(PATH.LOGIN);
2727
break;
2828
}
2929
case HTTP_STATUS_CODE.NOT_FOUND: {
30-
Router.push("/404");
30+
window.location.replace("/404");
3131
break;
3232
}
3333
}

0 commit comments

Comments
 (0)