-
-
+
+
-
-
-
-
-
+
+
+
+
);
}
diff --git a/client/src/pages/ErrorBoundary/index.tsx b/client/src/pages/ErrorBoundary/index.tsx
deleted file mode 100644
index 2f42b219..00000000
--- a/client/src/pages/ErrorBoundary/index.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { ReactNode } from "react";
-import CTAButton from "@/components/CTAButton";
-
-interface ErrorBoundaryProps {
- isError: boolean;
- fallbackUrl?: string;
- children?: ReactNode;
-}
-
-export default function ErrorBoundary({
- isError,
- fallbackUrl = "/",
- children,
-}: ErrorBoundaryProps) {
- if (isError) {
- return (
-
-
-
-
- 문제가 발생했습니다. 잠시 후 다시 시도해 보세요.
-
-
-
-
- );
- }
-
- return children;
-}
diff --git a/client/src/pages/ErrorElement/index.tsx b/client/src/pages/ErrorElement/index.tsx
new file mode 100644
index 00000000..dd867ee3
--- /dev/null
+++ b/client/src/pages/ErrorElement/index.tsx
@@ -0,0 +1,19 @@
+import CTAButton from "@/components/CTAButton";
+
+interface ErrorElementProps {
+ fallbackUrl?: string;
+}
+
+export default function ErrorElement({ fallbackUrl = "/" }: ErrorElementProps) {
+ return (
+
+
+
+
+ 문제가 발생했습니다. 잠시 후 다시 시도해 보세요.
+
+
+
+
+ );
+}
diff --git a/client/src/pages/Lottery/index.tsx b/client/src/pages/Lottery/index.tsx
index 6402b63d..448b29df 100644
--- a/client/src/pages/Lottery/index.tsx
+++ b/client/src/pages/Lottery/index.tsx
@@ -28,7 +28,6 @@ import { PostAuthResponse } from "@/types/authApi";
import { GetLotteryResponse } from "@/types/lotteryApi";
import { PHONE_NUMBER_ACTION } from "@/types/phoneNumber";
import { getMsTime } from "@/utils/getMsTime";
-import ErrorBoundary from "../ErrorBoundary";
export default function Lottery() {
useScrollTop();
@@ -43,7 +42,6 @@ export default function Lottery() {
const {
data: authToken,
isSuccess: isSuccessGetAuthToken,
- isError: isErrorGetAuthToken,
fetchData: getAuthToken,
} = useFetch
((val: string) =>
AuthAPI.getAuthToken({ phoneNumber: val })
@@ -94,29 +92,27 @@ export default function Lottery() {
}, [lotteryData]);
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {PopupComponent}
- {ToastComponent}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {PopupComponent}
+ {ToastComponent}
+
);
}
diff --git a/client/src/router.tsx b/client/src/router.tsx
index 2fd3d201..8ddc81be 100644
--- a/client/src/router.tsx
+++ b/client/src/router.tsx
@@ -3,7 +3,7 @@ import { LotteryAPI } from "./apis/lotteryAPI";
import Layout from "./components/Layout";
import CasperCustom from "./pages/CasperCustom";
import CasperShowCase from "./pages/CasperShowCase";
-import ErrorBoundary from "./pages/ErrorBoundary";
+import ErrorElement from "./pages/ErrorElement";
import Lottery from "./pages/Lottery";
import Main from "./pages/Main";
import NotFound from "./pages/NotFound";
@@ -29,7 +29,7 @@ export const router = createBrowserRouter([
index: true,
element: ,
loader: LotteryAPI.getLottery,
- errorElement: ,
+ errorElement: ,
},
{
path: "custom",
@@ -39,7 +39,7 @@ export const router = createBrowserRouter([
path: "show-case",
element: ,
loader: LotteryAPI.getCasperList,
- errorElement: ,
+ errorElement: ,
},
],
},
diff --git a/client/yarn.lock b/client/yarn.lock
index e00f62b4..e76914a0 100644
--- a/client/yarn.lock
+++ b/client/yarn.lock
@@ -5466,6 +5466,13 @@ react-element-to-jsx-string@^15.0.0:
is-plain-object "5.0.0"
react-is "18.1.0"
+react-error-boundary@^4.0.13:
+ version "4.0.13"
+ resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-4.0.13.tgz#80386b7b27b1131c5fbb7368b8c0d983354c7947"
+ integrity sha512-b6PwbdSv8XeOSYvjt8LpgpKrZ0yGdtZokYwkwV2wlcZbxgopHX/hgPl5VgpnoVOWd868n1hktM8Qm4b+02MiLQ==
+ dependencies:
+ "@babel/runtime" "^7.12.5"
+
react-is@18.1.0:
version "18.1.0"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67"
@@ -5967,16 +5974,7 @@ storybook@^8.2.5:
tiny-invariant "^1.3.1"
ts-dedent "^2.0.0"
-"string-width-cjs@npm:string-width@^4.2.0":
- version "4.2.3"
- resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
- integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
- dependencies:
- emoji-regex "^8.0.0"
- is-fullwidth-code-point "^3.0.0"
- strip-ansi "^6.0.1"
-
-string-width@^4.1.0:
+"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -6055,14 +6053,7 @@ string_decoder@^1.1.1:
dependencies:
safe-buffer "~5.2.0"
-"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
- integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
- dependencies:
- ansi-regex "^5.0.1"
-
-strip-ansi@^6.0.0, strip-ansi@^6.0.1:
+"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==