Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions frontend/app/application/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import NavbarSkeleton from "@/components/application/loader/Navbar.skeleton";
import QuestionSkeleton from "@/components/application/loader/Question.skeleton";
import { CURRENT_GENERATION, PRODUCTION_HOSTNAME } from "@/src/constants";
import { CURRENT_GENERATION } from "@/src/constants";
import {
APPLICATION_DESIGN,
APPLICATION_NAVBAR_DESIGN,
Expand All @@ -22,7 +22,7 @@ import {
} from "@/src/stores/application";
import { useSetAtom } from "jotai";
import dynamic from "next/dynamic";
import { useRouter, usePathname } from "next/navigation";
import { usePathname } from "next/navigation";
import { useEffect } from "react";

const ApplicationNavbar = dynamic(
Expand All @@ -42,13 +42,9 @@ const ApplicationQuestion = dynamic(
);

const ApplicationPage = () => {
const {
START_DATE,
} = require(`@/src/constants/application/${CURRENT_GENERATION}`);
const setApplicationDate = useSetAtom(applicationDataAtom);
const fieldData = localStorage.get<string>("field", "");
const setApplicationNavbar = useSetAtom(applicationNavbarAtom);
const router = useRouter();
const pathname = usePathname();

// 현재 사용자의 URL 정보 가져오기
Expand All @@ -63,23 +59,6 @@ const ApplicationPage = () => {
}
}, [pathname]);

// FIXME: 서버의 시작 시간과 연동하면 좋겠다..
useEffect(() => {
const now = new Date();
const startDate = new Date(
START_DATE.year,
START_DATE.month - 1,
START_DATE.date,
START_DATE.hours,
START_DATE.minutes,
START_DATE.seconds
);
if (now < startDate && window.location.hostname === PRODUCTION_HOSTNAME) {
alert("1차 모집 시작 전입니다.");
router.push("/");
}
}, []);

useEffect(() => {
switch (fieldData) {
case "디자이너":
Expand Down