Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #57 from Stocodi/feature/error
Browse files Browse the repository at this point in the history
Feature: 404, Service Not Available 페이지 구현
  • Loading branch information
toothlessdev authored Jan 15, 2024
2 parents 6ce3454 + 6222608 commit 19d5e0d
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import LectureSearchResultPage from "./pages/lecture-page/LectureSearchResultPag
import LectureViewPage from "./pages/lecture-page/LectureViewPage";
import LectureUploadPage from "./pages/lecture-page/LectureUploadPage";

import PageNotFound from "./pages/PageNotFound";
import TestPage from "./pages/test-page/TestPage";
import QuestionPage from "./pages/test-page/QuestionPage";
import ResultPage from "./pages/test-page/ResultPage";

import PageNotFound from "./pages/PageNotFound";
import ServiceNotAvailablePage from "./pages/ServiceNotAvailable";

export default function App() {
const pathname = useLocation();

Expand All @@ -40,6 +42,11 @@ export default function App() {
<Route path="lectures/view/:id" element={<LectureViewPage />} />
<Route path="lectures/upload" element={<LectureUploadPage />} />

<Route path="/experiment" element={<ServiceNotAvailablePage />} />
<Route path="/community" element={<ServiceNotAvailablePage />} />
<Route path="/mypage/*" element={<ServiceNotAvailablePage />} />
<Route path="/column" element={<ServiceNotAvailablePage />} />

<Route path="/about" element={<AboutPage />} />
<Route path="*" element={<PageNotFound />} />
</Route>
Expand Down
53 changes: 53 additions & 0 deletions src/pages/PageNotFound.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@import "@/styles/utils";

.page_wrapper {
width: 100%;
height: calc(100vh - $nav-height);

margin: 200px auto;

text-align: center;

img {
display: block;

width: 150px;
margin: 0px auto;
}
h1 {
padding: 0px 20px;

font-size: 5rem;
font-family: "Chillax";
font-weight: bold;
color: $color-primary;
}
p {
font-size: 1rem;
}
button {
margin: 30px auto;
}
}

@include tablet {
.page_wrapper {
img {
width: 100px;
}
h1 {
font-size: 4rem;
}
}
}

@include mobile {
.page_wrapper {
img {
width: 100px;
}
h1 {
font-size: 3rem;
}
}
}
23 changes: 22 additions & 1 deletion src/pages/PageNotFound.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
import { useNavigate } from "react-router-dom";
import { Button } from "../interfaces/forms/Button";

import styles from "./PageNotFound.module.scss";

export default function PageNotFound() {
return <>Page Not Found</>;
const navigate = useNavigate();

const onReturnClick = () => {
navigate("/");
};

return (
<div className={styles.page_wrapper}>
<img src="/icons/stocodi-letter.png" alt="" />
<h1>404 Not Found</h1>
<p>페이지를 찾을 수 없습니다</p>

<Button type="primary-filled" width="min(400px, 80%)" height="50px" onClick={onReturnClick}>
홈으로 돌아가기
</Button>
</div>
);
}
53 changes: 53 additions & 0 deletions src/pages/ServiceNotAvailable.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@import "@/styles/utils";

.page_wrapper {
width: 100%;
height: calc(100vh - $nav-height);

margin: 200px auto;

text-align: center;

img {
display: block;

width: 150px;
margin: 0px auto;
}
h1 {
padding: 0px 20px;

font-size: 5rem;
font-family: "Chillax";
font-weight: bold;
color: $color-primary;
}
p {
font-size: 1rem;
}
button {
margin: 30px auto;
}
}

@include tablet {
.page_wrapper {
img {
width: 100px;
}
h1 {
font-size: 4rem;
}
}
}

@include mobile {
.page_wrapper {
img {
width: 100px;
}
h1 {
font-size: 3rem;
}
}
}
23 changes: 23 additions & 0 deletions src/pages/ServiceNotAvailable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useNavigate } from "react-router-dom";
import { Button } from "../interfaces/forms/Button";
import styles from "./ServiceNotAvailable.module.scss";

export default function ServiceNotAvailablePage() {
const navigate = useNavigate();

const onReturnClick = () => {
navigate("/");
};

return (
<div className={styles.page_wrapper}>
<img src="/icons/stocodi-letter.png" alt="" />
<h1>Service Not Available</h1>
<p>서비스 준비중입니다</p>

<Button type="primary-filled" width="min(400px, 80%)" height="50px" onClick={onReturnClick}>
홈으로 돌아가기
</Button>
</div>
);
}

0 comments on commit 19d5e0d

Please sign in to comment.