Skip to content

Commit

Permalink
feat: 어드민 화면 에러페이지 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene028 committed Aug 24, 2024
1 parent 92657e9 commit b84cd6a
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 5 deletions.
54 changes: 52 additions & 2 deletions apps/admin/app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
"use client";
const ErrorPage = () => {
return <div>error</div>;

import { css } from "@styled-system/css";
import { Flex } from "@styled-system/jsx";
import { Header, Text } from "@wow-class/ui";
import Image from "next/image";
import Button from "wowds-ui/Button";

const ErrorPage = ({ reset }: { reset: () => void }) => {
const handleClickResetButton = () => {
reset();
};

return (
<html lang="ko">
<body>
<Flex direction="column" minHeight="100vh">
<Header />
<main className={errorPageContentStyle}>
<Image
alt="error"
height={344}
src="/images/error.svg"
width={358}
/>
<Text as="h2" typo="display2">
에러가 발생했어요
</Text>
<Button
aria-label="다시 시도"
style={buttonStyle}
onClick={handleClickResetButton}
>
다시 시도
</Button>
</main>
</Flex>
</body>
</html>
);
};

export default ErrorPage;

const errorPageContentStyle = css({
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
gap: "48px",
height: "100%",
});

const buttonStyle = {
width: 328,
};
1 change: 1 addition & 0 deletions apps/admin/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ body {
font-family: "SUIT" !important;
display: flex;
flex-direction: row;
min-height: 100vh;
}
55 changes: 52 additions & 3 deletions apps/admin/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
const NotFound = () => {
return <div>요청하신 페이지를 찾을 수 없어요.</div>;
import { css } from "@styled-system/css";
import { Flex } from "@styled-system/jsx";
import { Header, Text } from "@wow-class/ui";
import { routerPath } from "constants/router/routerPath";
import Image from "next/image";
import Link from "next/link";
import Button from "wowds-ui/Button";

const NotFoundPage = () => {
return (
<Flex direction="column" minHeight="100vh">
<Header />
<main className={notFoundPageContentStyle}>
<Image
alt="not-found"
height={344}
src="/images/not-found.svg"
width={358}
/>
<Flex direction="column" gap="md">
<Text as="h2" typo="display2">
오류가 발생했어요
</Text>
<Text color="sub" typo="body0">
요청하신 페이지를 찾을 수 없어요
</Text>
</Flex>
<Button
aria-label="홈으로 이동"
asProp={Link}
href={routerPath.root.href}
style={buttonStyle}
>
홈으로 이동
</Button>
</main>
</Flex>
);
};

export default NotFound;
export default NotFoundPage;

const notFoundPageContentStyle = css({
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
gap: "48px",
height: "100%",
});

const buttonStyle = {
width: 328,
};
29 changes: 29 additions & 0 deletions apps/admin/public/images/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions apps/admin/public/images/not-found.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b84cd6a

Please sign in to comment.