Skip to content

Commit 2f4bece

Browse files
committed
fix: 페이지 리뉴얼을 위한 middleware 추가
1 parent 5f5c700 commit 2f4bece

3 files changed

Lines changed: 103 additions & 47 deletions

File tree

mosu-app/src/middleware.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { NextRequest, NextResponse } from "next/server";
2+
3+
export const config = {
4+
matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"],
5+
};
6+
7+
export function middleware(request: NextRequest) {
8+
const isMaintenanceMode = process.env.MAINTENANCE_MODE === "true";
9+
10+
if (request.nextUrl.pathname === "/maintenance") {
11+
return NextResponse.next();
12+
}
13+
14+
if (isMaintenanceMode) {
15+
return NextResponse.redirect(new URL("/maintenance", request.url));
16+
}
17+
18+
return NextResponse.next();
19+
}

mosu-app/src/pages/_app.tsx

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import { GlobalLayout } from "@/apps/ui/GlobalLayout";
1717

1818
import { BannerProvider } from "@/features/banner/contexts/BannerProvider";
1919

20-
import { useOverlay } from "@/shared/hooks/useOverlay";
21-
2220
type AppPropsWithLayout = AppProps & {
2321
Component: NextPage & { layout?: (page: React.ReactNode) => React.ReactNode };
2422
};
@@ -34,55 +32,10 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
3432
const Page = Layout(<Component {...pageProps} />);
3533
const router = useRouter();
3634

37-
const { render: renderOverlay } = useOverlay({
38-
title: "안내사항",
39-
initialOpen: true,
40-
});
41-
42-
const overlayContent = (
43-
<div className="text-sm">
44-
<p className="mb-4">
45-
「모의가 아닌 진짜 수능」은 기존에 시험지 지참 방식으로만 운영되었으나, 이번에 시대인재 서바이벌 프로를
46-
도입하여 학생들에게 ① 개인 시험지 지참 방식 또는 ② 서바이벌 프로 및 더 프리미엄 모의고사 응시 두 가지
47-
선택지를 제공하게 되었습니다.
48-
</p>
49-
<p className="mb-4">
50-
이에 따라 금일부터 홈페이지 리뉴얼 작업이 진행되며, 당분간은 홈페이지 결제가 아닌 선착순 사전 예약 신청
51-
방식으로 접수를 받습니다.
52-
</p>
53-
<p className="mb-4">
54-
리뉴얼 완료 후에는 예약자분들께 문자로 상세 안내를 드릴 예정이며, 기존 신청자분들께도 별도로 안내 문자가
55-
발송될 예정입니다.
56-
</p>
57-
<p className="mb-4">
58-
<a
59-
href="https://docs.google.com/forms/d/1wR4EWZn1uQTkNFkNdfsAUairlKgTwf4kFxvMS8SdJdI/viewform"
60-
target="_blank"
61-
rel="noopener noreferrer"
62-
className="text-blue-500 hover:underline"
63-
>
64-
선착순 사전 예약하기
65-
</a>
66-
</p>
67-
<p className="mb-4">자세한 사항은 카카오톡 채널 또는 공식 인스타그램을 통해 확인 부탁드립니다.</p>
68-
<p>
69-
카카오톡 채널 :
70-
<a href="https://pf.kakao.com/_xhHxjxin" className="text-blue-500 hover:underline">
71-
https://pf.kakao.com/_xhHxjxin
72-
</a>
73-
</p>
74-
<p>인스타그램 : </p>
75-
<a href="https://www.instagram.com/mosu2627/" className="text-blue-500 hover:underline">
76-
https://www.instagram.com/mosu2627/
77-
</a>
78-
</div>
79-
);
80-
8135
return (
8236
<CookiesProvider>
8337
<QueryClientProvider client={queryClient}>
8438
<BannerProvider>
85-
{renderOverlay(overlayContent)}
8639
{process.env.NEXT_PUBLIC_GTM_ID && <GoogleTagManager gtmId={process.env.NEXT_PUBLIC_GTM_ID} />}
8740
{process.env.NEXT_PUBLIC_GA_ID && <GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GA_ID} />}
8841
<ToastContainer

mosu-app/src/pages/maintenance.tsx

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
export default function MaintenancePage() {
2+
return (
3+
<div className="w-full bg-black">
4+
<div className="mx-auto w-full max-w-3xl border border-black bg-black p-8 shadow-2xl">
5+
<header className="mb-8 text-center">
6+
<h1 className="mb-2 text-4xl font-extrabold text-blue-400">모의가 아닌 진짜 수능</h1>
7+
<p className="text-lg text-gray-400">새로운 응시 방식 도입 및 홈페이지 리뉴얼 안내</p>
8+
</header>
9+
10+
<section className="mb-8">
11+
<h2 className="mb-4 border-l-4 border-blue-400 pl-4 text-2xl font-bold text-gray-200">
12+
응시 방식 변경
13+
</h2>
14+
<div className="space-y-4 text-gray-300">
15+
<p>
16+
기존 시험지 지참 방식으로만 운영되던 「모의가 아닌 진짜 수능」이 시대인재 서바이벌 프로를
17+
도입하여 두 가지 응시 선택지를 제공합니다.
18+
</p>
19+
<ol className="list-inside list-decimal space-y-2 text-gray-400">
20+
<li>개인 시험지 지참 방식</li>
21+
<li>서바이벌 프로 및 더 프리미엄 모의고사 응시</li>
22+
</ol>
23+
</div>
24+
</section>
25+
26+
<hr className="my-8 border-gray-700" />
27+
28+
<section className="mb-8">
29+
<h2 className="mb-4 border-l-4 border-blue-400 pl-4 text-2xl font-bold text-gray-200">
30+
접수 방법 및 안내
31+
</h2>
32+
<div className="space-y-4 text-gray-300">
33+
<p>
34+
금일부터 홈페이지 리뉴얼 작업이 진행됨에 따라, 당분간은 선착순 사전 예약 신청 방식으로
35+
접수를 받습니다.
36+
</p>
37+
<div className="rounded-lg bg-gray-700 p-4 text-center shadow-inner">
38+
<p className="mb-2 text-lg font-semibold text-gray-100">선착순 사전 예약 신청 링크</p>
39+
<a
40+
href="https://docs.google.com/forms/d/1wR4EWZn1uQTkNFkNdfsAUairlKgTwf4kFxvMS8SdJdI/viewform"
41+
className="inline-block transform rounded-full bg-blue-500 px-6 py-2 font-bold text-white transition-colors duration-300 hover:scale-105 hover:bg-blue-600"
42+
target="_blank"
43+
>
44+
예약 신청 바로가기
45+
</a>
46+
</div>
47+
</div>
48+
</section>
49+
50+
<hr className="my-8 border-gray-700" />
51+
52+
<section className="mb-8">
53+
<h2 className="mb-4 border-l-4 border-blue-400 pl-4 text-2xl font-bold text-gray-200">향후 일정</h2>
54+
<div className="space-y-4 text-gray-300">
55+
<ul className="list-inside list-disc space-y-2 text-gray-400">
56+
<li>홈페이지 리뉴얼 완료 후, 예약자분들께 문자로 상세 안내가 발송될 예정입니다.</li>
57+
<li>기존 신청자분들께도 별도의 안내 문자가 발송됩니다.</li>
58+
</ul>
59+
</div>
60+
</section>
61+
62+
<hr className="my-8 border-gray-700" />
63+
64+
<footer className="text-center text-gray-400">
65+
<p className="mb-2">더 자세한 내용은 아래 채널을 통해 확인해 주세요.</p>
66+
<div className="flex justify-center space-x-4">
67+
<a
68+
href="https://pf.kakao.com/_xhHxjxin"
69+
className="text-blue-400 transition-colors duration-300 hover:text-blue-300"
70+
>
71+
카카오톡 채널
72+
</a>
73+
<a
74+
href="https://www.instagram.com/mosu2627"
75+
className="text-blue-400 transition-colors duration-300 hover:text-blue-300"
76+
>
77+
공식 인스타그램
78+
</a>
79+
</div>
80+
</footer>
81+
</div>
82+
</div>
83+
);
84+
}

0 commit comments

Comments
 (0)