-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
146 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
import { CookiesProvider } from "react-cookie"; | ||
import { ErrorBoundary } from "react-error-boundary"; | ||
import { Outlet } from "react-router-dom"; | ||
import { PhoneNumberProvider } from "@/contexts/phoneNumberContext"; | ||
import { ScrollHeaderStyleProvider } from "@/contexts/scrollHeaderStyleContext.tsx"; | ||
import ErrorElement from "@/pages/ErrorElement"; | ||
import Header from "../Header"; | ||
|
||
export default function Layout() { | ||
return ( | ||
<CookiesProvider> | ||
<ScrollHeaderStyleProvider> | ||
<PhoneNumberProvider> | ||
<Header /> | ||
<Outlet /> | ||
</PhoneNumberProvider> | ||
</ScrollHeaderStyleProvider> | ||
</CookiesProvider> | ||
<ErrorBoundary fallback={<ErrorElement fallbackUrl="/" />}> | ||
<CookiesProvider> | ||
<ScrollHeaderStyleProvider> | ||
<PhoneNumberProvider> | ||
<Header /> | ||
<Outlet /> | ||
</PhoneNumberProvider> | ||
</ScrollHeaderStyleProvider> | ||
</CookiesProvider> | ||
</ErrorBoundary> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import CTAButton from "@/components/CTAButton"; | ||
|
||
interface ErrorElementProps { | ||
fallbackUrl?: string; | ||
} | ||
|
||
export default function ErrorElement({ fallbackUrl = "/" }: ErrorElementProps) { | ||
return ( | ||
<div className="fixed z-10 h-screen w-full bg-n-neutral-950 flex flex-col justify-center items-center"> | ||
<img alt="오류 아이콘" src="/assets/icons/casper-error.svg" /> | ||
<div className="mt-4" /> | ||
<h3 className="h-heading-3-bold text-n-white"> | ||
문제가 발생했습니다. 잠시 후 다시 시도해 보세요. | ||
</h3> | ||
<div className="mt-12" /> | ||
<CTAButton label="돌아가기" url={fallbackUrl} hasArrowIcon /> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.